Skip to content

Commit

Permalink
Type hint .transport.{CHN_IND,roadmap} (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Aug 1, 2024
1 parent 1bda7ae commit b7dbb00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions message_ix_models/model/transport/CHN_IND.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _convert(group_df):
return group_df.assign(Value=qty.magnitude, Units=qty.units)


def split_variable(s):
def split_variable(s) -> pd.DataFrame:
"""Split strings in :class:`pandas.Series` *s* into Variable and Mode.
Parameters
Expand Down Expand Up @@ -97,7 +97,7 @@ def split_variable(s):
return df


def get_ind_item_data():
def get_ind_item_data() -> pd.DataFrame:
"""Retrieve activity data for rail and road transport for India from iTEM.
Data is obtained from iTEM database's file ``T000.csv`` and filtered for the
Expand Down Expand Up @@ -134,7 +134,7 @@ def get_ind_item_data():
return all_data


def get_chn_ind_pop():
def get_chn_ind_pop() -> pd.DataFrame:
"""Retrieve population data for China and India.
The dataset is a ``.csv`` file in */data* and was retrieved from `OECD
Expand All @@ -157,7 +157,7 @@ def get_chn_ind_pop():
return pop


def get_chn_ind_data(private_vehicles=False):
def get_chn_ind_data(private_vehicles=False) -> pd.DataFrame:
"""Read transport activity and vehicle stock data for China and India.
The data is read from ``data/transport`` folder (data for China from NBSC) and
Expand Down
4 changes: 3 additions & 1 deletion message_ix_models/model/transport/roadmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@
)


def get_roadmap_data(context, region=("Africa", "R11_AFR"), years=None, plot=False):
def get_roadmap_data(
context, region=("Africa", "R11_AFR"), years=None, plot=False
) -> pd.DataFrame:
"""Read transport activity data for Africa.
The data is read from ``RoadmapResults_2017.xlsx``, which is already aggregated
Expand Down

0 comments on commit b7dbb00

Please sign in to comment.