Skip to content

Commit

Permalink
Merge pull request #211 from OSeMOSYS/issue_194
Browse files Browse the repository at this point in the history
  • Loading branch information
willu47 authored Dec 18, 2023
2 parents f9ffec2 + 34166a3 commit 1197393
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Changelog
=========

(Development) Version 1.1.3
===========================
- Lock pandas to 2.1.4 or later

Version 1.1.2
=============
- Update zenodo metadata for JOSS
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ flatten_dict
Jinja2<3.1
networkx
openpyxl
pandas>=1.1,<2.1
pandas>=2.1.4
pydantic>=2
pydot
pyyaml
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ install_requires =
xlrd
pyyaml
pydot
pandas>=1.1,<2.1
pandas>=2.1.4
Amply>=0.1.6
networkx
flatten_dict
Expand Down
7 changes: 5 additions & 2 deletions src/otoole/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,11 @@ def _expand_defaults(
df_default["VALUE"] = default_values[name]

# combine result and default value dataframe
df = pd.concat([data, df_default])
df = df[~df.index.duplicated(keep="first")]
if not data.empty:
df = pd.concat([data, df_default])
df = df[~df.index.duplicated(keep="first")]
else:
df = df_default
df = df.sort_index()
output[name] = df

Expand Down
2 changes: 1 addition & 1 deletion tests/test_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def result_data(region):
input_data_single_index_empty(region),
]
parameter_test_data_ids = [
"multi_index_no_defaluts",
"multi_index_no_defaults",
"multi_index",
"multi_index_empty",
"single_index",
Expand Down

0 comments on commit 1197393

Please sign in to comment.