Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (and test) missing cost category in results #151

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions ptxboa/data/dim_process.csv
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Green iron reduction,DRI,DRI-S,H2-G,True,False,False,False,PROC,False,False,Fals
Green iron ship,DRI-S,DRI-S,DRI-S,False,False,True,False,TRANSP-S,False,True,False,False,ProcessTransportShip,Transportation (Ship)
Green iron ship (bunker fuel consumption),DRI-SB,DRI-S,DRI-S,False,False,True,False,TRANSP-S,False,False,False,False,ProcessTransportShip,Transportation (Ship),BFUEL-L
FT e-fuels Synthesis (Fischer-Tropsch),EFUELSYN,CHX-L,H2-G,True,False,False,False,PROC,False,False,False,True,ProcessDerivate,Derivate production,H2O-L/CO2-G/EL/HEAT/N2-G
electricity storage,EL-STR,EL,EL,False,False,True,False,PROC,False,True,False,False,ProcessDerivate,Derivate production,H2O-L/CO2-G/EL/HEAT/N2-G
electricity transmission,EL-TRANS,EL,EL,False,False,True,False,TRANSP,False,True,False,False,ProcessPassthrough
electricity storage,EL-STR,EL,EL,False,False,True,False,PROC,False,True,False,False,ProcessDerivate,Electrolysis,H2O-L/CO2-G/EL/HEAT/N2-G
electricity transmission,EL-TRANS,EL,EL,False,False,True,False,TRANSP,False,True,False,False,ProcessPassthrough,Electrolysis
Hydrogen compression,H2-COMP,H2-G,H2-G,True,False,True,False,TRANSP-P,False,False,False,False,ProcessTransportPrePost,Transportation (Pipeline),HEAT/EL
Hydrogen Liquification,H2-LIQ,H2-L,H2-G,True,False,True,False,TRANSP-S,False,False,False,False,ProcessTransportPrePost,Transportation (Ship),HEAT/EL
Hydrogen land pipeline new,H2-P-L,H2-G,H2-G,False,False,True,False,TRANSP-P,False,False,False,False,ProcessTransportPipeline,Transportation (Pipeline)
Expand All @@ -37,7 +37,7 @@ LOHC conversion,LOHC-CON,LOHC-L,H2-G,True,False,True,False,TRANSP-S,False,False,
LOHC reconversion,LOHC-REC,H2-G,LOHC-L,True,False,True,False,TRANSP-S,False,False,False,False,ProcessTransportPrePost,Transportation (Ship),HEAT/EL
LOHC ship (own fuel consumption),LOHC-S,LOHC-L,LOHC-L,False,False,True,False,TRANSP-S,False,False,False,False,ProcessTransportShip,Transportation (Ship)
LOHC ship (bunker fuel consumption),LOHC-SB,LOHC-L,LOHC-L,False,False,True,False,TRANSP-S,False,False,False,False,ProcessTransportShip,Transportation (Ship),BFUEL-L
Ammonia reconversion,NH3-REC,H2-G,NH3-L,True,False,True,False,TRANSP,False,False,False,False,ProcessPassthrough
Ammonia reconversion,NH3-REC,H2-G,NH3-L,True,False,True,False,TRANSP,False,False,False,False,ProcessPassthrough,Transportation (Ship)
Ammonia ship (own fuel consumption),NH3-S,NH3-L,NH3-L,False,False,True,False,TRANSP-S,False,False,False,False,ProcessTransportShip,Transportation (Ship)
Ammonia ship (bunker fuel consumption),NH3-SB,NH3-L,NH3-L,False,False,True,False,TRANSP-S,False,False,False,False,ProcessTransportShip,Transportation (Ship),BFUEL-L
Ammonia Synthesis (Haber-Bosch),NH3SYN,NH3-L,H2-G,True,False,False,False,PROC,False,False,False,True,ProcessDerivate,Derivate production,H2O-L/CO2-G/EL/HEAT/N2-G
Expand Down
18 changes: 18 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,24 @@ def _test_api_call(self, settings):

return res

def test_issue_145_undefined_cost_category(self):
"""See https://github.com/agoenergy/ptx-boa/issues/145."""
settings = {
"region": "United Arab Emirates",
"country": "Germany",
"chain": "Ammonia (AEL) + reconv. to H2",
"res_gen": "PV tilted",
"scenario": "2040 (medium)",
"secproc_co2": "Direct Air Capture",
"secproc_water": "Sea Water desalination",
"transport": "Ship",
"ship_own_fuel": False,
"output_unit": "USD/t",
}
res = self._test_api_call(settings)
level_cost_category = res.index.levels[0]
self.assertFalse("" in level_cost_category, "empty value in cost_category")

def test_example_api_call_1_ship(self):
"""Test output structure of api.calculate()."""
settings = {
Expand Down