Skip to content

Commit

Permalink
Resolve errors from mypy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
glatterf42 committed Aug 22, 2024
1 parent f545c69 commit 44d9e4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions message_ix_models/model/water/data/demands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand Down
8 changes: 4 additions & 4 deletions message_ix_models/model/water/data/water_supply.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 44d9e4c

Please sign in to comment.