Skip to content

Commit a4c4cb4

Browse files
committed
whenxuan: black init
1 parent 5125e88 commit a4c4cb4

6 files changed

Lines changed: 731 additions & 691 deletions

File tree

‎cvmd2d.ipynb‎

Lines changed: 0 additions & 593 deletions
This file was deleted.

‎examples/cvmd2d.ipynb‎

Lines changed: 600 additions & 0 deletions
Large diffs are not rendered by default.

‎examples/mvmd.ipynb‎

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,14 @@
118118
"from pysdkit import MVMD, VMD\n",
119119
"from pysdkit.data import test_multivariate_signal\n",
120120
"\n",
121-
"plt.rcParams.update({\n",
122-
" \"figure.dpi\": 120,\n",
123-
" \"font.size\": 11,\n",
124-
" \"axes.grid\": True,\n",
125-
" \"grid.alpha\": 0.25,\n",
126-
"})\n",
121+
"plt.rcParams.update(\n",
122+
" {\n",
123+
" \"figure.dpi\": 120,\n",
124+
" \"font.size\": 11,\n",
125+
" \"axes.grid\": True,\n",
126+
" \"grid.alpha\": 0.25,\n",
127+
" }\n",
128+
")\n",
127129
"\n",
128130
"\n",
129131
"def relative_error(ref, est):\n",
@@ -428,8 +430,11 @@
428430
" axs[k, c].set_title(f\"Mode {k+1} | ch{c+1} | f≈{omega_hz[k]:.1f} Hz\")\n",
429431
" e = mode_energies(modes[k])\n",
430432
" axs[k, c].text(\n",
431-
" 0.02, 0.85, f\"E=[{e[0]:.0f}, {e[1]:.0f}]\",\n",
432-
" transform=axs[k, c].transAxes, fontsize=8,\n",
433+
" 0.02,\n",
434+
" 0.85,\n",
435+
" f\"E=[{e[0]:.0f}, {e[1]:.0f}]\",\n",
436+
" transform=axs[k, c].transAxes,\n",
437+
" fontsize=8,\n",
433438
" )\n",
434439
" axs[k, 0].set_xlim(0, 0.5)\n",
435440
"axs[-1, 0].set_xlabel(\"Time [s]\")\n",
@@ -718,7 +723,9 @@
718723
"\n",
719724
"fig, ax = plt.subplots(figsize=(4.8, 4.2))\n",
720725
"im = ax.imshow(acc, vmin=0, vmax=1, cmap=\"gray_r\")\n",
721-
"ax.set_title(f\"Mean |corr| of MVMD modes on {C}-ch wGn\\n(average over {n_real} realizations)\")\n",
726+
"ax.set_title(\n",
727+
" f\"Mean |corr| of MVMD modes on {C}-ch wGn\\n(average over {n_real} realizations)\"\n",
728+
")\n",
722729
"ax.set_xlabel(\"Mode index\")\n",
723730
"ax.set_ylabel(\"Mode index\")\n",
724731
"fig.colorbar(im, ax=ax, fraction=0.046)\n",
File renamed without changes.

‎examples/vmd.ipynb‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,14 @@
122122
"from pysdkit.data import test_emd\n",
123123
"from pysdkit.plot import plot_IMFs, plot_IMFs_amplitude_spectra\n",
124124
"\n",
125-
"plt.rcParams.update({\n",
126-
" \"figure.dpi\": 120,\n",
127-
" \"font.size\": 11,\n",
128-
" \"axes.grid\": True,\n",
129-
" \"grid.alpha\": 0.25,\n",
130-
"})\n",
125+
"plt.rcParams.update(\n",
126+
" {\n",
127+
" \"figure.dpi\": 120,\n",
128+
" \"font.size\": 11,\n",
129+
" \"axes.grid\": True,\n",
130+
" \"grid.alpha\": 0.25,\n",
131+
" }\n",
132+
")\n",
131133
"\n",
132134
"\n",
133135
"def relative_error(ref, est):\n",
@@ -348,7 +350,7 @@
348350
"imfs0 = vmd0.fit_transform(s0)\n",
349351
"print(\"modes shape:\", imfs0.shape)\n",
350352
"re0 = relative_error(s0[: imfs0.shape[1]], imfs0.sum(0))\n",
351-
"print(f\"relative recon. error: {re0:.4e}\")\n"
353+
"print(f\"relative recon. error: {re0:.4e}\")"
352354
]
353355
},
354356
{
@@ -675,7 +677,9 @@
675677
"fig.suptitle(\"VMD decomposition (K=3)\", y=1.01)\n",
676678
"plt.show()\n",
677679
"\n",
678-
"fig = plot_IMFs(signal, imfs_emd, max_imfs=min(7, imfs_emd.shape[0]), return_figure=True)\n",
680+
"fig = plot_IMFs(\n",
681+
" signal, imfs_emd, max_imfs=min(7, imfs_emd.shape[0]), return_figure=True\n",
682+
")\n",
679683
"fig.suptitle(f\"EMD decomposition ({imfs_emd.shape[0]} IMFs)\", y=1.01)\n",
680684
"plt.show()\n",
681685
"\n",

0 commit comments

Comments
 (0)