@@ -131,7 +131,10 @@ def create_df(
131131
132132 n_ts = n_scenarios * n_variables * n_runs
133133 df = pd .DataFrame (
134- 50.0 * np .linspace (0.3 , 1 , n_ts )[:, np .newaxis ] * np .linspace (0 , 1 , timepoints .size )[np .newaxis , :] + np .random .random ((n_ts , timepoints .size )),
134+ 50.0
135+ * np .linspace (0.3 , 1 , n_ts )[:, np .newaxis ]
136+ * np .linspace (0 , 1 , timepoints .size )[np .newaxis , :]
137+ + np .random .random ((n_ts , timepoints .size )),
135138 columns = timepoints ,
136139 index = idx ,
137140 )
@@ -185,12 +188,16 @@ def create_df(
185188# this can be quite powerful for quick plots.
186189
187190# %%
188- ax = small_ts .loc [pix .isin (variable = "variable_0" )].ct .plot (continuous_plot_kwargs = dict (alpha = 0.3 ))
191+ ax = small_ts .loc [pix .isin (variable = "variable_0" )].ct .plot (
192+ continuous_plot_kwargs = dict (alpha = 0.3 )
193+ )
189194ax .legend (ncols = 3 , loc = "upper center" , bbox_to_anchor = (0.5 , - 0.15 ))
190195
191196# %%
192197# TODO: move this to plotting section
193- ax = small_ts .loc [pix .isin (variable = "variable_0" , run = 0 )].ct .plot (label = "scenario" , continuous_plot_kwargs = dict (alpha = 0.9 ))
198+ ax = small_ts .loc [pix .isin (variable = "variable_0" , run = 0 )].ct .plot (
199+ label = "scenario" , continuous_plot_kwargs = dict (alpha = 0.9 )
200+ )
194201ax .legend ()
195202
196203# %% [markdown]
@@ -272,8 +279,7 @@ def create_df(
272279
273280# %%
274281ax = (
275- bigger_df
276- .loc [pix .isin (variable = "variable_1" )]
282+ bigger_df .loc [pix .isin (variable = "variable_1" )]
277283 .groupby (["scenario" , "variable" , "units" ], observed = True )
278284 .median ()
279285 .loc [pix .ismatch (scenario = "scenario_1*" )]
@@ -297,7 +303,9 @@ def create_df(
297303small_ts .ct .to_df (increase_resolution = 3 )
298304
299305# %%
300- sns_df = small_ts .loc [pix .isin (scenario = [f"scenario_{ i } " for i in range (2 )])].ct .to_sns_df (increase_resolution = 100 )
306+ sns_df = small_ts .loc [
307+ pix .isin (scenario = [f"scenario_{ i } " for i in range (2 )])
308+ ].ct .to_sns_df (increase_resolution = 100 )
301309sns_df
302310
303311# %%
0 commit comments