Skip to content

Commit

Permalink
running flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
adrivinca committed Aug 24, 2023
1 parent 882a31a commit 254e311
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion message_ix_models/model/water/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 4 additions & 2 deletions message_ix_models/model/water/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 254e311

Please sign in to comment.