Skip to content

Commit

Permalink
remove all dependencies from R11
Browse files Browse the repository at this point in the history
this was is form another older branch
  • Loading branch information
adrivinca committed Oct 22, 2024
1 parent d1c7d1b commit 447afeb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions message_ix_models/model/water/data/water_supply.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def map_basin_region_wat(context: "Context") -> pd.DataFrame:
df_sw["MSGREG"] = (
context.map_ISO_c[context.regions]
if context.type_reg == "country"
else f"{context.regions}_" + df_sw["BCU_name"].str[-3:]
else f"{context.regions}_" + df_sw["BCU_name"].str.split("|").str[-1]
)

df_sw = df_sw.set_index(["MSGREG", "BCU_name"])
Expand Down Expand Up @@ -97,7 +97,9 @@ def map_basin_region_wat(context: "Context") -> pd.DataFrame:
if context.type_reg == "country":
df_sw["MSGREG"] = context.map_ISO_c[context.regions]
else:
df_sw["MSGREG"] = f"{context.regions}_" + df_sw["BCU_name"].str[-3:]
df_sw["MSGREG"] = (
f"{context.regions}_" + df_sw["BCU_name"].str.split("|").str[-1]
)

df_sw = df_sw.set_index(["MSGREG", "BCU_name"])
df_sw.drop(columns="Unnamed: 0", inplace=True)
Expand Down
2 changes: 1 addition & 1 deletion message_ix_models/model/water/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ def report(sc: Scenario, reg: str, sdgs: bool = False) -> None:
for ur in ["urban", "rural"]:
# CHANGE TO URBAN AND RURAL POP
pop_tot = sc.timeseries(variable=("Population|" + ur.capitalize()))
pop_tot = pop_tot[-(pop_tot.region == "GLB region (R11)")]
pop_tot = pop_tot[-(pop_tot.region == "GLB region (R11)")] # ONLY R11!!!
pop_reg = np.unique(pop_tot["region"])
# need to change names
reg_map = mp2.regions()
Expand Down

0 comments on commit 447afeb

Please sign in to comment.