Skip to content

Commit 79a9936

Browse files
committed
Black of the tutorials
1 parent 0b018dd commit 79a9936

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

tutorials/tutorial20/costs-tutorial_real-data.ipynb

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
" step_size_array=step_sizes,\n",
231231
" global_svd_array=global_svd_array,\n",
232232
" cluster_sweep=True,\n",
233-
" transform_method='absolute',\n",
233+
" transform_method=\"absolute\",\n",
234234
" )\n",
235235
"\n",
236236
" mrc.fit(data, np.atleast_2d(ts))"
@@ -803,47 +803,49 @@
803803
"source": [
804804
"da = mrc._da_omega\n",
805805
"x = da.values\n",
806-
"x = x.reshape(len(da.window_length), len(da.window_time_means) * len(da.svd_rank))\n",
806+
"x = x.reshape(\n",
807+
" len(da.window_length), len(da.window_time_means) * len(da.svd_rank)\n",
808+
")\n",
807809
"\n",
808810
"# Squared frequencies\n",
809811
"x_trans = np.abs(x.imag) ** 2 / (2 * np.pi)\n",
810812
"plt.figure(figsize=(5, 2.5))\n",
811813
"plt.hist(\n",
812814
" x=x_trans.T,\n",
813815
" bins=np.linspace(0, 0.005, 100),\n",
814-
" histtype='barstacked',\n",
816+
" histtype=\"barstacked\",\n",
815817
" density=True,\n",
816818
" label=range(mrc.n_decompositions),\n",
817-
");\n",
819+
")\n",
818820
"plt.gca().set_title(\"Global histogram; Interpolated decomposition levels\")\n",
819821
"plt.gca().set_xlabel(r\"$Im(\\omega)^2 (2 \\pi)^{-1}$ (s$^2$)\")\n",
820-
"plt.legend(title='decomposition level')\n",
822+
"plt.legend(title=\"decomposition level\")\n",
821823
"\n",
822824
"# Frequency\n",
823825
"plt.figure(figsize=(5, 2.5))\n",
824826
"x_trans = np.abs(x.imag) / (2 * np.pi)\n",
825827
"plt.hist(\n",
826828
" x=x_trans.T,\n",
827829
" bins=100,\n",
828-
" histtype='barstacked',\n",
830+
" histtype=\"barstacked\",\n",
829831
" density=True,\n",
830832
" label=range(mrc.n_decompositions),\n",
831-
");\n",
833+
")\n",
832834
"plt.gca().set_title(\"Global histogram; Interpolated decomposition levels\")\n",
833835
"plt.gca().set_xlabel(r\"$Im(|\\omega|) (2 \\pi)^{-1}$ (s$^{-1}$)\")\n",
834-
"plt.legend(title='decomposition level')\n",
836+
"plt.legend(title=\"decomposition level\")\n",
835837
"\n",
836838
"# Period\n",
837839
"plt.figure(figsize=(5, 2.5))\n",
838840
"x_trans = (2 * np.pi) / np.abs(x.imag)\n",
839841
"plt.hist(\n",
840842
" x=x_trans.T,\n",
841843
" bins=100,\n",
842-
" histtype='barstacked',\n",
844+
" histtype=\"barstacked\",\n",
843845
" density=True,\n",
844846
" label=range(mrc.n_decompositions),\n",
845-
");\n",
846-
"plt.legend(title='decomposition level')\n",
847+
")\n",
848+
"plt.legend(title=\"decomposition level\")\n",
847849
"plt.gca().set_title(\"Global histogram; Interpolated decomposition levels\")\n",
848850
"plt.gca().set_xlabel(r\"Period; $(2 \\pi) / Im(|\\omega|)$ (s)\")"
849851
]
@@ -911,15 +913,15 @@
911913
"plt.hist(\n",
912914
" x=x_trans.T,\n",
913915
" bins=np.logspace(start=np.log10(20), stop=np.log10(1300), num=100),\n",
914-
" histtype='barstacked',\n",
916+
" histtype=\"barstacked\",\n",
915917
" label=range(mrc.n_decompositions),\n",
916918
" weights=weights.T,\n",
917-
");\n",
918-
"plt.xscale('log')\n",
919-
"plt.legend(title='decomposition level')\n",
919+
")\n",
920+
"plt.xscale(\"log\")\n",
921+
"plt.legend(title=\"decomposition level\")\n",
920922
"plt.gca().set_title(\"Global histogram; Interpolated decomposition levels\")\n",
921923
"plt.gca().set_xlabel(r\"Period; $(2 \\pi) / Im(|\\omega|)$ (s)\")\n",
922-
"plt.gca().set_ylabel('Weighted Count (-)')"
924+
"plt.gca().set_ylabel(\"Weighted Count (-)\")"
923925
]
924926
},
925927
{
@@ -1054,7 +1056,7 @@
10541056
},
10551057
"outputs": [],
10561058
"source": [
1057-
"x_trans = (2 * np.pi / 10**omega_array)\n",
1059+
"x_trans = 2 * np.pi / 10**omega_array\n",
10581060
"unique_labels, label_counts = np.unique(omega_classes, return_counts=True)\n",
10591061
"weights = label_counts.max() / label_counts\n",
10601062
"x_trans_labels = [x_trans[omega_classes == label] for label in unique_labels]\n",
@@ -1067,7 +1069,7 @@
10671069
" w = weights[ind_array]\n",
10681070
" x_w = x_trans_labels[ind_list]\n",
10691071
" w_broadcast = np.broadcast_to(w, (x_w.shape))\n",
1070-
" weights_labels.append(w_broadcast)\n"
1072+
" weights_labels.append(w_broadcast)"
10711073
]
10721074
},
10731075
{
@@ -1099,21 +1101,21 @@
10991101
"plt.hist(\n",
11001102
" x=x_trans_labels,\n",
11011103
" bins=np.logspace(start=np.log10(20), stop=np.log10(1300), num=100),\n",
1102-
" histtype='barstacked',\n",
1103-
" weights=weights_labels\n",
1104-
");\n",
1104+
" histtype=\"barstacked\",\n",
1105+
" weights=weights_labels,\n",
1106+
")\n",
11051107
"\n",
11061108
"ax = plt.gca()\n",
1107-
"ax.set_xscale('log')\n",
1109+
"ax.set_xscale(\"log\")\n",
11081110
"ax.set_title(\n",
11091111
" \"Global histogram of frequencies; Interpolated decomposition levels\"\n",
11101112
")\n",
11111113
"ax.set_xlabel(r\"Period; $(2 \\pi) / Im(|\\omega|)$ (s)\")\n",
1112-
"ax.set_ylabel('Density (-)')\n",
1114+
"ax.set_ylabel(\"Density (-)\")\n",
11131115
"[\n",
11141116
" ax.axvline(2 * np.pi / (10**c), color=\"k\", ls=\"--\")\n",
11151117
" for nc, c in enumerate(cluster_centroids)\n",
1116-
"];\n",
1118+
"]\n",
11171119
"\n",
11181120
"ylim_bottom, ylim_top = ax.get_ylim()\n",
11191121
"[\n",
@@ -1126,7 +1128,7 @@
11261128
" ha=\"right\",\n",
11271129
" )\n",
11281130
" for c in cluster_centroids\n",
1129-
"];\n"
1131+
"];"
11301132
]
11311133
},
11321134
{

tutorials/tutorial20/costs-tutorial_toy-data.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@
877877
" step_size_array=step_sizes,\n",
878878
" global_svd_array=global_svd_array,\n",
879879
" n_components_array=n_components_array,\n",
880-
" transform_method=transform_method\n",
880+
" transform_method=transform_method,\n",
881881
")\n",
882882
"\n",
883883
"mrc.fit(data, np.atleast_2d(time))"

0 commit comments

Comments
 (0)