From 254e311c975b95fa14e5e9de9f9cde5d252c20db Mon Sep 17 00:00:00 2001 From: adrivinca Date: Thu, 24 Aug 2023 17:52:54 +0200 Subject: [PATCH] running flake8 --- message_ix_models/model/water/cli.py | 2 +- message_ix_models/model/water/reporting.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/message_ix_models/model/water/cli.py b/message_ix_models/model/water/cli.py index ea2926450c..a58b3cca6f 100644 --- a/message_ix_models/model/water/cli.py +++ b/message_ix_models/model/water/cli.py @@ -256,7 +256,7 @@ def cooling(context, regions, rcps, rels): @click.option( "--water", is_flag=True, - help="By default running legacy and water (full) otherwise only water, if specified", + help="Default running legacy and water (full) otherwise only water, if specified", ) @common_params("output_model") def report_cli(context, output_model, sdgs, water=False): diff --git a/message_ix_models/model/water/reporting.py b/message_ix_models/model/water/reporting.py index d111e92d7d..adc90c3660 100644 --- a/message_ix_models/model/water/reporting.py +++ b/message_ix_models/model/water/reporting.py @@ -1317,14 +1317,16 @@ def collapse_callback(df): ["model", "scenario", "variable", "unit", "year", "subannual"] ) renamed_df = pd.DataFrame(columns=report_pd.columns) - # Step 2: Check if there is at least one "world" row and one "country" row for each group + # Step 2: Check if there is at least one "world" row and one "country" + # row for each group for name, group in grouped: if ( "World" in group["region"].values and country_n in group["region"].values ): report_pd.drop(group.index, inplace=True) - # Step 4: Rename "world" to "country" and remove rows with region = "country" + # Step 4: Rename "world" to "country" and remove rows with + # region = "country" group = group[group["region"] == "World"] group.loc[group["region"] == "World", "region"] = country_n # Step 5: Update the original dataframe with the modified group