diff --git a/message_ix_models/model/water/data/demands.py b/message_ix_models/model/water/data/demands.py index d9618e2b7f..856fdf611c 100644 --- a/message_ix_models/model/water/data/demands.py +++ b/message_ix_models/model/water/data/demands.py @@ -201,7 +201,6 @@ def add_sectoral_demands(context: "Context") -> dict[str, pd.DataFrame]: for key, df in d.items(): df.rename(columns={"Unnamed: 0": "year"}, inplace=True) df.set_index("year", inplace=True) - df = df.drop(columns=["year"]) dfs[key] = df # convert the dictionary of dataframes to xarray @@ -928,7 +927,7 @@ def add_water_availability(context: "Context") -> dict[str, pd.DataFrame]: df_share = make_df( "share_commodity_lo", shares="share_low_lim_GWat", - node_share="B" + df_gw["Region"], + node_share="B" + df_gw["Region"].astype(str), year_act=df_gw["year"], time=df_gw["time"], value=df_gw["value"] diff --git a/message_ix_models/model/water/data/water_supply.py b/message_ix_models/model/water/data/water_supply.py index 968a14eab2..471513c359 100644 --- a/message_ix_models/model/water/data/water_supply.py +++ b/message_ix_models/model/water/data/water_supply.py @@ -2,7 +2,7 @@ import numpy as np import pandas as pd -from message_ix import make_df +from message_ix import Scenario, make_df from message_ix_models import Context from message_ix_models.model.water.data.demands import read_water_availability @@ -144,8 +144,8 @@ def add_water_supply(context: "Context") -> dict[str, pd.DataFrame]: # Reference to the water configuration info = context["water build info"] # load the scenario from context - scen = context.get_scenario() - # scen = Scenario(context.get_platform(), **context.core.scenario_info) + # scen = context.get_scenario() + scen = Scenario(context.get_platform(), **context.core.scenario_info) # year_wat = (2010, 2015) fut_year = info.Y @@ -857,7 +857,7 @@ def add_e_flow(context: "Context") -> dict[str, pd.DataFrame]: # dataframe to put constraints on env flows eflow_df = make_df( "bound_activity_lo", - node_loc="B" + df_env["Region"], + node_loc="B" + df_env["Region"].astype(str), technology="return_flow", year_act=df_env["year"], mode="M1",