Skip to content

Commit ed3095c

Browse files
adrivincamacflo8
authored andcommitted
Clarify report comment; recode water supply fix
1 parent 6f04e88 commit ed3095c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

message_ix_models/model/water/data/water_supply.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,11 @@ def map_basin_region_wat(context: "Context") -> pd.DataFrame:
9494
# Reading data, the data is spatially and temporally aggregated from GHMs
9595
df_sw["BCU_name"] = df_x["BCU_name"]
9696

97-
if context.type_reg == "country":
98-
df_sw["MSGREG"] = context.map_ISO_c[context.regions]
99-
else:
100-
df_sw["MSGREG"] = (
101-
f"{context.regions}_" + df_sw["BCU_name"].str.split("|").str[-1]
102-
)
97+
df_sw["MSGREG"] = (
98+
context.map_ISO_c[context.regions]
99+
if context.type_reg == "country"
100+
else f"{context.regions}_" + df_sw["BCU_name"].str.split("|").str[-1]
101+
)
103102

104103
df_sw = df_sw.set_index(["MSGREG", "BCU_name"])
105104
df_sw.drop(columns="Unnamed: 0", inplace=True)

message_ix_models/model/water/report.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,8 @@ def report(sc: Scenario, reg: str, sdgs: bool = False) -> None:
11131113
for ur in ["urban", "rural"]:
11141114
# CHANGE TO URBAN AND RURAL POP
11151115
pop_tot = sc.timeseries(variable=("Population|" + ur.capitalize()))
1116-
pop_tot = pop_tot[-(pop_tot.region == "GLB region (R11)")] # ONLY R11!!!
1116+
# ONLY R11!!! Need to fix when updating the reporting to work with any region
1117+
pop_tot = pop_tot[-(pop_tot.region == "GLB region (R11)")]
11171118
pop_reg = np.unique(pop_tot["region"])
11181119
# need to change names
11191120
reg_map = mp2.regions()

0 commit comments

Comments
 (0)