Skip to content

Commit 62d8784

Browse files
committed
Black fixes
1 parent 5cf446c commit 62d8784

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

tutorials/tutorial1/tutorial-1-dmd.ipynb

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"outputs": [],
3636
"source": [
3737
"import warnings\n",
38+
"\n",
3839
"warnings.filterwarnings(\"ignore\")\n",
3940
"\n",
4041
"import numpy as np\n",
@@ -74,9 +75,11 @@
7475
"def f1(x, t):\n",
7576
" return 1.0 / np.cosh(x + 3) * np.cos(2.3 * t)\n",
7677
"\n",
78+
"\n",
7779
"def f2(x, t):\n",
7880
" return 2.0 / np.cosh(x) * np.tanh(x) * np.sin(2.8 * t)\n",
7981
"\n",
82+
"\n",
8083
"nx = 65 # number of grid points along space dimension\n",
8184
"nt = 129 # number of grid points along time dimension\n",
8285
"\n",
@@ -267,7 +270,9 @@
267270
"\n",
268271
"# Print computed eigenvalues (frequencies are given by imaginary components).\n",
269272
"# Also plot the resulting data reconstruction.\n",
270-
"print(f\"Frequencies (imaginary component): {np.round(delay_optdmd.eigs, decimals=3)}\")\n",
273+
"print(\n",
274+
" f\"Frequencies (imaginary component): {np.round(delay_optdmd.eigs, decimals=3)}\"\n",
275+
")\n",
271276
"plt.title(\"Reconstructed Data\")\n",
272277
"plt.imshow(delay_optdmd.reconstructed_data.real)\n",
273278
"plt.show()\n",
@@ -437,12 +442,16 @@
437442
"# Imaginary + Conjugate: constrain to imaginary axis and as complex conjugates.\n",
438443
"# bopdmd = BOPDMD(eig_constraints={\"imag\", \"conjugate_pairs\"})\n",
439444
"\n",
440-
"optdmd = BOPDMD(svd_rank=4, num_trials=0, eig_constraints={\"imag\", \"conjugate_pairs\"})\n",
445+
"optdmd = BOPDMD(\n",
446+
" svd_rank=4, num_trials=0, eig_constraints={\"imag\", \"conjugate_pairs\"}\n",
447+
")\n",
441448
"delay_optdmd = hankel_preprocessing(optdmd, d=delays)\n",
442449
"delay_optdmd.fit(Xn.T, t=t[:num_t])\n",
443450
"plot_summary(delay_optdmd, d=delays)\n",
444451
"\n",
445-
"print(f\"Frequencies (imaginary component): {np.round(delay_optdmd.eigs, decimals=3)}\")\n",
452+
"print(\n",
453+
" f\"Frequencies (imaginary component): {np.round(delay_optdmd.eigs, decimals=3)}\"\n",
454+
")\n",
446455
"plt.title(\"Reconstructed Data\")\n",
447456
"plt.imshow(delay_optdmd.reconstructed_data.real)\n",
448457
"plt.show()\n",
@@ -516,7 +525,9 @@
516525
"delay_dmd.fit(Xn.T)\n",
517526
"plot_summary(delay_dmd, d=delays)\n",
518527
"\n",
519-
"print(f\"Frequencies (imaginary component): {np.round(np.log(delay_dmd.eigs) / dt, decimals=3)}\")\n",
528+
"print(\n",
529+
" f\"Frequencies (imaginary component): {np.round(np.log(delay_dmd.eigs) / dt, decimals=3)}\"\n",
530+
")\n",
520531
"plt.title(\"Reconstructed Data\")\n",
521532
"plt.imshow(delay_dmd.reconstructed_data.real)\n",
522533
"plt.show()\n",
@@ -593,7 +604,9 @@
593604
"dmd.fit(X.T)\n",
594605
"plot_summary(dmd)\n",
595606
"\n",
596-
"print(f\"Frequencies (imaginary component): {np.round(np.log(dmd.eigs) / dt, decimals=3)}\")\n",
607+
"print(\n",
608+
" f\"Frequencies (imaginary component): {np.round(np.log(dmd.eigs) / dt, decimals=3)}\"\n",
609+
")\n",
597610
"plt.title(\"Reconstructed Data\")\n",
598611
"plt.imshow(dmd.reconstructed_data.real)\n",
599612
"plt.show()\n",
@@ -658,7 +671,9 @@
658671
"delay_dmd.fit(X.T)\n",
659672
"plot_summary(delay_dmd, d=2)\n",
660673
"\n",
661-
"print(f\"Frequencies (imaginary component): {np.round(np.log(delay_dmd.eigs) / dt, decimals=3)}\")\n",
674+
"print(\n",
675+
" f\"Frequencies (imaginary component): {np.round(np.log(delay_dmd.eigs) / dt, decimals=3)}\"\n",
676+
")\n",
662677
"plt.title(\"Reconstructed Data\")\n",
663678
"plt.imshow(delay_dmd.reconstructed_data.real)\n",
664679
"plt.show()\n",

0 commit comments

Comments
 (0)