Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
7fbfb6c
code: unit test for get_excel_sheets
finozzifa Jan 24, 2025
2ec34f1
Merge branch 'master' of https://github.com/open-energy-transition/te…
finozzifa Jan 24, 2025
8f40db1
pre-commit
finozzifa Jan 24, 2025
b2efc33
code: move sheet_names to _helpers.py
finozzifa Jan 24, 2025
9cf87d5
code: modify years_list
finozzifa Jan 24, 2025
be66811
output: cost outputs
finozzifa Jan 27, 2025
074e1e0
Merge branch 'master' of https://github.com/open-energy-transition/te…
finozzifa Jan 29, 2025
2b43e07
code: merge from master
finozzifa Jan 29, 2025
5516b47
code: new unit tests
finozzifa Jan 30, 2025
11543fe
code: revert changes to _helpers.py
finozzifa Jan 30, 2025
d339277
code:fix quick issues
finozzifa Jan 30, 2025
c31a02f
code: add logger
finozzifa Jan 31, 2025
a9aa5df
code: add docstrings
finozzifa Jan 31, 2025
f07979d
add pre-commit changes
finozzifa Jan 31, 2025
8af30ca
code: modify sheet location method
finozzifa Jan 31, 2025
d020522
code: add docstring
finozzifa Jan 31, 2025
98b92b8
code: unit test clean_up_units
finozzifa Jan 31, 2025
45e33c3
code: add docstring for get_dea_martime_data
finozzifa Feb 3, 2025
299220f
code: add unit test for set_specify_assumptions
finozzifa Feb 3, 2025
4afab7d
code: add docstring for set_specify_assumptions
finozzifa Feb 3, 2025
eb2a7ad
code: remove assert False
finozzifa Feb 3, 2025
01c398d
code: unit test for set_round_trip_efficiency
finozzifa Feb 4, 2025
a3af10d
include pre-commit
finozzifa Feb 4, 2025
8dadf6c
code: switch to numpydoc and introduce static types
finozzifa Feb 5, 2025
43f3391
code:include pre-commit
finozzifa Feb 5, 2025
c5898bf
code: numpydoc and static types for order_data
finozzifa Feb 5, 2025
6d20ebb
code:replace print with logger statements
finozzifa Feb 5, 2025
1e6e000
code: add logger
finozzifa Feb 5, 2025
04a4346
Merge branch 'master' of https://github.com/PyPSA/technology-data int…
finozzifa Feb 5, 2025
d4c7f5a
code: modify static type
finozzifa Feb 5, 2025
62f4962
docu: update numpydoc to the requested standard
finozzifa Feb 5, 2025
80e1e0d
Merge branch 'master' of https://github.com/open-energy-transition/te…
finozzifa Feb 6, 2025
1e7ec73
code: add unit test for add_description
finozzifa Feb 10, 2025
ac97bdf
modify logger msg
finozzifa Feb 10, 2025
ce3706d
code: fix logger messages
finozzifa Feb 10, 2025
f843db9
code: add unit test for convert_units
finozzifa Feb 14, 2025
58d72a6
code: add numpydoc for add_gas_storage
finozzifa Feb 14, 2025
b2fc9e9
code: new changes
finozzifa Feb 17, 2025
5a61847
Merge branch 'master' of https://github.com/PyPSA/technology-data int…
finozzifa Feb 17, 2025
6a11f07
code: add numpydoc
finozzifa Feb 17, 2025
0709e06
code: re-factor and numpydoc'
finozzifa Feb 17, 2025
12be7dc
code: add new numpydoc
finozzifa Feb 17, 2025
933ac90
code: add new numpydoc - 2
finozzifa Feb 17, 2025
6adb0bf
code: add new numpydoc - 3
finozzifa Feb 17, 2025
9b9b40e
doc: update release_notes.rst
finozzifa Feb 17, 2025
76beb53
code: remove unit test for dea_maritime
finozzifa Feb 17, 2025
c3af440
code: add numpydoc for carbon_flow
finozzifa Feb 17, 2025
6dffb71
code: pre-commit for carbon_flow
finozzifa Feb 17, 2025
9864097
code: numpydoc for add_egs_data
finozzifa Feb 17, 2025
450caec
code: add unit test for annuity
finozzifa Feb 17, 2025
3502f7a
code: merge from master
finozzifa Feb 18, 2025
044a1b7
code: update numpydoc and naming
finozzifa Feb 18, 2025
6bc4579
code: add numpydoc to compile_cost_assumptions_usa.py
finozzifa Feb 19, 2025
189f4e5
code: replace list_of_years to years
finozzifa Feb 19, 2025
b3fc382
code: numpydoc for final batch of functions
finozzifa Feb 19, 2025
6893e65
code: replace NoneType with empty DataFrame
finozzifa Feb 19, 2025
38d6be2
code: pre-commit run all
finozzifa Feb 19, 2025
6ffd02b
code: new changes
finozzifa Feb 19, 2025
8e49c14
Merge branch 'master' of https://github.com/PyPSA/technology-data int…
finozzifa Feb 19, 2025
9257fdc
code: add logging to file
finozzifa Feb 19, 2025
518c616
code: pre-commit run --all
finozzifa Feb 19, 2025
c72297b
code: add unit test for geometric_series and logger
finozzifa Feb 19, 2025
114582c
code: numpydoc for geometric_series
finozzifa Feb 19, 2025
659d0ae
code: update numpydoc
finozzifa Feb 22, 2025
dd2ea29
code: shorten conftest.py
finozzifa Feb 22, 2025
244f97e
code: shorten the conftest.py
finozzifa Feb 24, 2025
5fb0048
code: unit test for prepare_inflation_rate
finozzifa Feb 24, 2025
d22ac06
code: include pre-commit
finozzifa Feb 24, 2025
22a3437
code: update on conftest.py
finozzifa Feb 24, 2025
2d68c9e
code: update on conftest.py - 2
finozzifa Feb 24, 2025
a42d2f8
code: add unit test for add_gas_storage
finozzifa Feb 27, 2025
3671445
code: add pre-commit checks
finozzifa Feb 27, 2025
7e7e961
code: add unit test for add_carbon_capture
finozzifa Feb 28, 2025
455e40f
code: shorten tests
finozzifa Feb 28, 2025
c2cb23c
code: shorten test code
finozzifa Feb 28, 2025
3d6644c
code: shorten test code - 2
finozzifa Feb 28, 2025
dc8f09f
Merge branch 'master' of https://github.com/PyPSA/technology-data int…
finozzifa Mar 3, 2025
6f7e285
Merge branch 'master' of https://github.com/PyPSA/technology-data int…
finozzifa Mar 10, 2025
a2b228a
Merge branch 'master' of https://github.com/PyPSA/technology-data int…
finozzifa Mar 12, 2025
1834dce
Merge branch 'master' of https://github.com/PyPSA/technology-data int…
finozzifa Mar 14, 2025
7d59781
Merge branch 'master' of https://github.com/PyPSA/technology-data int…
finozzifa Mar 25, 2025
26fcb38
Merge branch 'master' of https://github.com/PyPSA/technology-data int…
finozzifa Apr 15, 2025
b8c6bd6
code: unit tests for get_dea_vehicle_data and rename_pypsa_old
finozzifa Apr 15, 2025
75223a2
docu: update release_notes.rst
finozzifa Apr 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Upcoming Release

* Updates ci.yaml such that it fails if the generated outputs are different than the ones committed (https://github.com/PyPSA/technology-data/pull/205)

* Include further unit tests for compile_cost_assumptions.py (https://github.com/PyPSA/technology-data/pull/209)

`v0.11.0 <https://github.com/PyPSA/technology-data/releases/tag/v0.11.0>`__ (24th January 2025)
=======================================================================================

Expand Down
44 changes: 43 additions & 1 deletion test/test_compile_cost_assumptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
dea_sheet_names,
geometric_series,
get_data_from_DEA,
get_dea_vehicle_data,
get_excel_sheets,
get_sheet_location,
rename_pypsa_old,
set_round_trip_efficiency,
set_specify_assumptions,
)
Expand Down Expand Up @@ -63,7 +65,6 @@ def test_clean_up_units(mock_input_data, mock_output_data, source):
mock_input_data.copy(deep=True), value_column="value", source=source
)
comparison_df = output_df.compare(expected_df)
print(comparison_df)
assert comparison_df.empty


Expand Down Expand Up @@ -741,3 +742,44 @@ def test_add_carbon_capture(config):
index=["2020", "source", "unit", "further description"],
)
)


def test_get_dea_vehicle_data(config):
"""
The test verifies what is returned by get_dea_vehicle_data.
"""
df = get_dea_vehicle_data(
snakemake_input_dictionary["dea_vehicles"], ["2020"], pd.DataFrame()
)
assert df.shape == (90, 5)
assert sorted(list(df.columns)) == sorted(
["2020", "unit", "source", "currency_year", "further description"]
)


def test_rename_pypsa_old():
"""
The test verifies what is returned by rename_pypsa_old.
"""
data = {
("decentral water tank storage", "investment"): [46.8],
("central CHP", "investment"): [3000],
("hydrogen underground storage", "investment"): [2000],
("retrofitting I", "investment"): [1000],
("retrofitting II", "investment"): [1500],
}
index = pd.MultiIndex.from_tuples(data.keys())
cost_dataframe_pypsa = pd.DataFrame(data.values(), index=index, columns=["value"])
expected_data = {
("decentral water tank storage", "investment"): [1.0],
("central gas CHP", "investment"): [3000],
("hydrogen storage underground", "investment"): [2000],
}
expected_index = pd.MultiIndex.from_tuples(expected_data.keys())
expected_df = pd.DataFrame(
expected_data.values(), index=expected_index, columns=["value"]
)
expected_df.loc[("decentral water tank storage", "investment"), "unit"] = "EUR/kWh"
output_df = rename_pypsa_old(cost_dataframe_pypsa)
comparison_df = output_df.compare(expected_df)
assert comparison_df.empty