Skip to content

Commit 96d704e

Browse files
committed
Fix ruff
1 parent bc0f316 commit 96d704e

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

message_ix_models/project/investment/workflow.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
def _extract_ssp_name(scenario_name):
2121
"""Extract SSP name from scenario name for file naming.
22-
22+
2323
Returns the SSP number (e.g., 'ssp2') if found, otherwise returns None.
2424
"""
2525
import re
@@ -166,15 +166,15 @@ def retrive_ori_inv_cost(platform_name=None, scenario_name=None, model_name=None
166166
Retrieve the original investment cost data from scenarios.
167167
Generate CSV files for each scenario in the list.
168168
Log the location of fixed effects regression data.
169-
169+
170170
Parameters
171171
----------
172172
platform_name : str, optional
173173
Platform name to use when loading scenarios. Defaults to "ixmp-dev".
174174
scenario_name : list of str, optional
175175
List of scenario names to process.
176176
model_name : str, optional
177-
Model name to use when loading scenarios. Defaults to
177+
Model name to use when loading scenarios. Defaults to
178178
"MESSAGEix-GLOBIOM 2.0-M-R12 Investment".
179179
"""
180180
import ixmp
@@ -269,7 +269,9 @@ def retrive_ori_inv_cost(platform_name=None, scenario_name=None, model_name=None
269269
if ssp_name is None:
270270
# No SSP pattern found, default to ssp2
271271
ssp_name = "ssp2"
272-
log.info(f"No SSP pattern found in {scen_name}, using ssp2 for filename")
272+
log.info(
273+
f"No SSP pattern found in {scen_name}, using ssp2 for filename"
274+
)
273275

274276
# Generate scenario-specific filename
275277
output_path = output_dir / f"{ssp_name}_inv_cost_ori.csv"
@@ -363,7 +365,7 @@ def generate(context: Context) -> Workflow:
363365
model_orig = "MESSAGEix-GLOBIOM 2.0-M-R12 Investment"
364366
platform_name = "ixmp-dev"
365367
model_name = f"ixmp://{platform_name}/{model_orig}"
366-
368+
367369
# List of all starting scenario names
368370
scen_names = [
369371
"ssp1_1000f",
@@ -375,7 +377,8 @@ def generate(context: Context) -> Workflow:
375377

376378
# Retrieve investment cost from all scenarios
377379
# Pass the entire list of scenario names to the function
378-
# First create a dummy base step that loads a scenario (needed because genno passes function as scenario when base=None)
380+
# First create a dummy base step that loads a scenario
381+
# (needed because genno passes function as scenario when base=None)
379382
dummy_target = f"{model_name}/{scen_names[0]}" # Use first scenario as dummy target
380383
wf.add_step(
381384
"base",
@@ -481,7 +484,7 @@ def generate(context: Context) -> Workflow:
481484
ssp_name = _extract_ssp_name(scen_name)
482485
if ssp_name and ssp_name not in ssp_names:
483486
ssp_names.append(ssp_name)
484-
487+
485488
ssp_grouping_steps = []
486489
for ssp_name in ssp_names:
487490
ssp_cf_steps = []
@@ -490,7 +493,7 @@ def generate(context: Context) -> Workflow:
490493
for cf_name in cf_names:
491494
combined_scen_name = f"{scen_name}_{cf_name}"
492495
ssp_cf_steps.append(f"coc reported {combined_scen_name}")
493-
496+
494497
ssp_step_name = f"coc reported {ssp_name}"
495498
wf.add_step(
496499
ssp_step_name,

0 commit comments

Comments
 (0)