diff --git a/ptxboa/api_calc.py b/ptxboa/api_calc.py index 74a65465..b0884f96 100644 --- a/ptxboa/api_calc.py +++ b/ptxboa/api_calc.py @@ -20,7 +20,6 @@ def calculate(data: CalculateDataType) -> pd.DataFrame: # get general parameters parameters = data["parameter"] wacc = parameters["WACC"] - storage_factor = parameters["STR-CF"] # start main chain calculation main_output_value = 1 # start with normalized value of 1 @@ -33,20 +32,6 @@ def calculate(data: CalculateDataType) -> pd.DataFrame: for step_data in data["main_process_chain"] + data["transport_process_chain"]: process_step = step_data["step"] process_code = step_data["process_code"] - is_shipping_or_pre_post = process_step in { - "PRE_SHP", - "SHP", - "SHP-OWN", - "POST_SHP", - } - is_pipeline_or_pre_post = process_step in { - "PRE_PPL", - "PPLS", - "PPL", - "PPLX", - "PPLR", - "POST_PPL", - } is_transport = process_step in { "SHP", "SHP-OWN", @@ -76,24 +61,6 @@ def calculate(data: CalculateDataType) -> pd.DataFrame: results.append((result_process_type, process_code, "CAPEX", capex_ann)) results.append((result_process_type, process_code, "OPEX", opex)) - if not (is_shipping_or_pre_post or is_pipeline_or_pre_post): - # no storage factor in transport pre/post - results.append( - ( - "Electricity and H2 storage", - process_code, - "OPEX", # NOTE: in old app,storage is always OPEX - capex_ann * storage_factor, - ) - ) - results.append( - ( - "Electricity and H2 storage", - process_code, - "OPEX", - opex * storage_factor, - ) - ) else: opex_t = step_data["OPEX-T"] dist_transport = step_data["DIST"] @@ -101,15 +68,6 @@ def calculate(data: CalculateDataType) -> pd.DataFrame: opex = (opex_o + opex_ot) * main_output_value results.append((result_process_type, process_code, "OPEX", opex)) - if not (is_shipping_or_pre_post or is_pipeline_or_pre_post): - results.append( - ( - "Electricity and H2 storage", - process_code, - "OPEX", - opex * storage_factor, - ) - ) # create flows for process step for flow_code, conv in step_data["CONV"].items(): flow_value = main_output_value * conv @@ -140,23 +98,6 @@ def calculate(data: CalculateDataType) -> pd.DataFrame: results.append( (sec_result_process_type, sec_process_code, "OPEX", opex) ) - if not (is_shipping_or_pre_post or is_pipeline_or_pre_post): - results.append( - ( - "Electricity and H2 storage", - sec_process_code, - "OPEX", # NOTE: in old app, storage is always OPEX - capex_ann * storage_factor, - ) - ) - results.append( - ( - "Electricity and H2 storage", - sec_process_code, - "OPEX", - opex * storage_factor, - ) - ) for sec_flow_code, sec_conv in sec_process_data["CONV"].items(): sec_flow_value = flow_value * sec_conv @@ -180,15 +121,6 @@ def calculate(data: CalculateDataType) -> pd.DataFrame: sec_flow_cost, ) ) - if not (is_shipping_or_pre_post or is_pipeline_or_pre_post): - results.append( - ( - "Electricity and H2 storage", - sec_process_code, - "OPEX", # NOTE: in old app, storage is always OPEX - sec_flow_cost * storage_factor, - ) - ) else: # use market @@ -210,15 +142,6 @@ def calculate(data: CalculateDataType) -> pd.DataFrame: results.append( (flow_result_process_type, process_code, "FLOW", flow_cost) ) - if not (is_shipping_or_pre_post or is_pipeline_or_pre_post): - results.append( - ( - "Electricity and H2 storage", - process_code, - "OPEX", # NOTE: in old app, storage is always OPEX - flow_cost * storage_factor, - ) - ) # convert to DataFrame dim_columns = ["process_type", "process_subtype", "cost_type"] diff --git a/ptxboa/api_data.py b/ptxboa/api_data.py index fd9803bc..c4836e05 100644 --- a/ptxboa/api_data.py +++ b/ptxboa/api_data.py @@ -190,11 +190,6 @@ def __init__( "process_flh", ), ) - self.storage_cost_factor = _load_data( - self.data_dir, - name="storage_cost_factor", - key_columns=("process_res", "process_ely", "process_deriv"), - ) scenario_filename = ( f"{scenario.replace(' ', '_').replace(')', '').replace('(', '')}" @@ -475,16 +470,6 @@ def _get_parameter_value( ] required_keys = set(keys) - elif parameter_code == "STR-CF": - # Storage cost factor not changed by user (and currently in separate file) - df = self.storage_cost_factor - keys = [ - "process_code_res", - "process_code_ely", - "process_code_deriv", - ] - required_keys = set(keys) - else: df = self.scenario_data keys = [ @@ -675,7 +660,6 @@ def get_flow_params(): } result["parameter"]["WACC"] = get_parameter_value_w_default("WACC") - result["parameter"]["STR-CF"] = get_parameter_value_w_default("STR-CF") result["parameter"]["CALOR"] = get_parameter_value_w_default( parameter_code="CALOR", flow_code=chain["FLOW_OUT"] ) diff --git a/ptxboa/data/_update.py b/ptxboa/data/_update.py index ae748cb6..87db07ad 100644 --- a/ptxboa/data/_update.py +++ b/ptxboa/data/_update.py @@ -8,16 +8,21 @@ import sqlalchemy as sa -def update_csv(query: str, filename: str, data_dir: str = None) -> None: +def update_csv( + query: str, filename: str, data_dir: str = None, check_uniue_cols: list = None +) -> None: data_dir = data_dir or os.path.dirname(__file__) CS = ( "mssql+pyodbc://?odbc_connect=driver=sql server;server=sqldaek2;database=ptxboa" ) engine = sa.create_engine(CS) - pd.read_sql( + df = pd.read_sql( query, engine, - ).to_csv(data_dir + "/" + filename, index=False, lineterminator="\n") + ) + if check_uniue_cols: + assert df.set_index(check_uniue_cols).index.is_unique + df.to_csv(data_dir + "/" + filename, index=False, lineterminator="\n") def main(): @@ -39,21 +44,6 @@ def main(): """, "flh.csv", ) - update_csv( - """ - select - "key", - "process_res", - "process_ely", - "process_deriv", - "value", - "source" - FROM "ptxboa_data_storage_factor" - WHERE value is not null - ORDER BY "key" - """, - "storage_cost_factor.csv", - ) for year in [2030, 2040]: for rng in ["high", "medium", "low"]: @@ -77,6 +67,13 @@ def main(): order by "key" """, f"{year}_{rng}.csv", + check_uniue_cols=[ + "parameter_code", + "process_code", + "flow_code", + "source_region_code", + "target_country_code", + ], ) diff --git a/ptxboa/data/storage_cost_factor.csv b/ptxboa/data/storage_cost_factor.csv deleted file mode 100644 index 87ba5cc5..00000000 --- a/ptxboa/data/storage_cost_factor.csv +++ /dev/null @@ -1,106 +0,0 @@ -key,process_res,process_ely,process_deriv,value,source -"PV-FIX,AEL-EL,",PV-FIX,AEL-EL,,0.0959,PTX Atlas / öko -"PV-FIX,AEL-EL,CH3OHSYN",PV-FIX,AEL-EL,CH3OHSYN,0.0664,PTX Atlas / öko -"PV-FIX,AEL-EL,CH4SYN",PV-FIX,AEL-EL,CH4SYN,0.073,PTX Atlas / öko -"PV-FIX,AEL-EL,DRI",PV-FIX,AEL-EL,DRI,0.073,PTX Atlas / öko -"PV-FIX,AEL-EL,EFUELSYN",PV-FIX,AEL-EL,EFUELSYN,0.0631,PTX Atlas / öko -"PV-FIX,AEL-EL,LOHC-CON",PV-FIX,AEL-EL,LOHC-CON,0.073,PTX Atlas / öko -"PV-FIX,AEL-EL,NH3SYN",PV-FIX,AEL-EL,NH3SYN,0.0482,PTX Atlas / öko -"PV-FIX,PEM-EL,",PV-FIX,PEM-EL,,0.0959,PTX Atlas / öko -"PV-FIX,PEM-EL,CH3OHSYN",PV-FIX,PEM-EL,CH3OHSYN,0.0664,PTX Atlas / öko -"PV-FIX,PEM-EL,CH4SYN",PV-FIX,PEM-EL,CH4SYN,0.073,PTX Atlas / öko -"PV-FIX,PEM-EL,DRI",PV-FIX,PEM-EL,DRI,0.073,PTX Atlas / öko -"PV-FIX,PEM-EL,EFUELSYN",PV-FIX,PEM-EL,EFUELSYN,0.0631,PTX Atlas / öko -"PV-FIX,PEM-EL,LOHC-CON",PV-FIX,PEM-EL,LOHC-CON,0.073,PTX Atlas / öko -"PV-FIX,PEM-EL,NH3SYN",PV-FIX,PEM-EL,NH3SYN,0.0482,PTX Atlas / öko -"PV-FIX,SOEC-EL,",PV-FIX,SOEC-EL,,0.1027,PTX Atlas / öko -"PV-FIX,SOEC-EL,CH3OHSYN",PV-FIX,SOEC-EL,CH3OHSYN,0.4926,PTX Atlas / öko -"PV-FIX,SOEC-EL,CH4SYN",PV-FIX,SOEC-EL,CH4SYN,0.4649,PTX Atlas / öko -"PV-FIX,SOEC-EL,DRI",PV-FIX,SOEC-EL,DRI,0.4649,PTX Atlas / öko -"PV-FIX,SOEC-EL,EFUELSYN",PV-FIX,SOEC-EL,EFUELSYN,0.5156,PTX Atlas / öko -"PV-FIX,SOEC-EL,LOHC-CON",PV-FIX,SOEC-EL,LOHC-CON,0.4649,PTX Atlas / öko -"PV-FIX,SOEC-EL,NH3SYN",PV-FIX,SOEC-EL,NH3SYN,0.2427,PTX Atlas / öko -"PV-TRK,AEL-EL,",PV-TRK,AEL-EL,,0.0959,PTX Atlas / öko -"PV-TRK,AEL-EL,CH3OHSYN",PV-TRK,AEL-EL,CH3OHSYN,0.0664,PTX Atlas / öko -"PV-TRK,AEL-EL,CH4SYN",PV-TRK,AEL-EL,CH4SYN,0.073,PTX Atlas / öko -"PV-TRK,AEL-EL,DRI",PV-TRK,AEL-EL,DRI,0.073,PTX Atlas / öko -"PV-TRK,AEL-EL,EFUELSYN",PV-TRK,AEL-EL,EFUELSYN,0.0631,PTX Atlas / öko -"PV-TRK,AEL-EL,LOHC-CON",PV-TRK,AEL-EL,LOHC-CON,0.073,PTX Atlas / öko -"PV-TRK,AEL-EL,NH3SYN",PV-TRK,AEL-EL,NH3SYN,0.0482,PTX Atlas / öko -"PV-TRK,PEM-EL,",PV-TRK,PEM-EL,,0.0959,PTX Atlas / öko -"PV-TRK,PEM-EL,CH3OHSYN",PV-TRK,PEM-EL,CH3OHSYN,0.0664,PTX Atlas / öko -"PV-TRK,PEM-EL,CH4SYN",PV-TRK,PEM-EL,CH4SYN,0.073,PTX Atlas / öko -"PV-TRK,PEM-EL,DRI",PV-TRK,PEM-EL,DRI,0.073,PTX Atlas / öko -"PV-TRK,PEM-EL,EFUELSYN",PV-TRK,PEM-EL,EFUELSYN,0.0631,PTX Atlas / öko -"PV-TRK,PEM-EL,LOHC-CON",PV-TRK,PEM-EL,LOHC-CON,0.073,PTX Atlas / öko -"PV-TRK,PEM-EL,NH3SYN",PV-TRK,PEM-EL,NH3SYN,0.0482,PTX Atlas / öko -"PV-TRK,SOEC-EL,",PV-TRK,SOEC-EL,,0.1027,PTX Atlas / öko -"PV-TRK,SOEC-EL,CH3OHSYN",PV-TRK,SOEC-EL,CH3OHSYN,0.4926,PTX Atlas / öko -"PV-TRK,SOEC-EL,CH4SYN",PV-TRK,SOEC-EL,CH4SYN,0.4649,PTX Atlas / öko -"PV-TRK,SOEC-EL,DRI",PV-TRK,SOEC-EL,DRI,0.4649,PTX Atlas / öko -"PV-TRK,SOEC-EL,EFUELSYN",PV-TRK,SOEC-EL,EFUELSYN,0.5156,PTX Atlas / öko -"PV-TRK,SOEC-EL,LOHC-CON",PV-TRK,SOEC-EL,LOHC-CON,0.4649,PTX Atlas / öko -"PV-TRK,SOEC-EL,NH3SYN",PV-TRK,SOEC-EL,NH3SYN,0.2427,PTX Atlas / öko -"RES-HYBR,AEL-EL,",RES-HYBR,AEL-EL,,0.0384,PTX Atlas / öko -"RES-HYBR,AEL-EL,CH3OHSYN",RES-HYBR,AEL-EL,CH3OHSYN,0.0397,PTX Atlas / öko -"RES-HYBR,AEL-EL,CH4SYN",RES-HYBR,AEL-EL,CH4SYN,0.0391,PTX Atlas / öko -"RES-HYBR,AEL-EL,DRI",RES-HYBR,AEL-EL,DRI,0.0391,PTX Atlas / öko -"RES-HYBR,AEL-EL,EFUELSYN",RES-HYBR,AEL-EL,EFUELSYN,0.037,PTX Atlas / öko -"RES-HYBR,AEL-EL,LOHC-CON",RES-HYBR,AEL-EL,LOHC-CON,0.0391,PTX Atlas / öko -"RES-HYBR,AEL-EL,NH3SYN",RES-HYBR,AEL-EL,NH3SYN,0.0213,PTX Atlas / öko -"RES-HYBR,PEM-EL,",RES-HYBR,PEM-EL,,0.0384,PTX Atlas / öko -"RES-HYBR,PEM-EL,CH3OHSYN",RES-HYBR,PEM-EL,CH3OHSYN,0.0397,PTX Atlas / öko -"RES-HYBR,PEM-EL,CH4SYN",RES-HYBR,PEM-EL,CH4SYN,0.0391,PTX Atlas / öko -"RES-HYBR,PEM-EL,DRI",RES-HYBR,PEM-EL,DRI,0.0391,PTX Atlas / öko -"RES-HYBR,PEM-EL,EFUELSYN",RES-HYBR,PEM-EL,EFUELSYN,0.037,PTX Atlas / öko -"RES-HYBR,PEM-EL,LOHC-CON",RES-HYBR,PEM-EL,LOHC-CON,0.0391,PTX Atlas / öko -"RES-HYBR,PEM-EL,NH3SYN",RES-HYBR,PEM-EL,NH3SYN,0.0213,PTX Atlas / öko -"RES-HYBR,SOEC-EL,",RES-HYBR,SOEC-EL,,0.0431,PTX Atlas / öko -"RES-HYBR,SOEC-EL,CH3OHSYN",RES-HYBR,SOEC-EL,CH3OHSYN,0.1218,PTX Atlas / öko -"RES-HYBR,SOEC-EL,CH4SYN",RES-HYBR,SOEC-EL,CH4SYN,0.1209,PTX Atlas / öko -"RES-HYBR,SOEC-EL,DRI",RES-HYBR,SOEC-EL,DRI,0.1209,PTX Atlas / öko -"RES-HYBR,SOEC-EL,EFUELSYN",RES-HYBR,SOEC-EL,EFUELSYN,0.1274,PTX Atlas / öko -"RES-HYBR,SOEC-EL,LOHC-CON",RES-HYBR,SOEC-EL,LOHC-CON,0.1209,PTX Atlas / öko -"RES-HYBR,SOEC-EL,NH3SYN",RES-HYBR,SOEC-EL,NH3SYN,0.0907,PTX Atlas / öko -"WIND-OFF,AEL-EL,",WIND-OFF,AEL-EL,,0.0065,PTX Atlas / öko -"WIND-OFF,AEL-EL,CH3OHSYN",WIND-OFF,AEL-EL,CH3OHSYN,0.0338,PTX Atlas / öko -"WIND-OFF,AEL-EL,CH4SYN",WIND-OFF,AEL-EL,CH4SYN,0.0267,PTX Atlas / öko -"WIND-OFF,AEL-EL,DRI",WIND-OFF,AEL-EL,DRI,0.0267,PTX Atlas / öko -"WIND-OFF,AEL-EL,EFUELSYN",WIND-OFF,AEL-EL,EFUELSYN,0.0298,PTX Atlas / öko -"WIND-OFF,AEL-EL,LOHC-CON",WIND-OFF,AEL-EL,LOHC-CON,0.0267,PTX Atlas / öko -"WIND-OFF,AEL-EL,NH3SYN",WIND-OFF,AEL-EL,NH3SYN,0.0047,PTX Atlas / öko -"WIND-OFF,PEM-EL,",WIND-OFF,PEM-EL,,0.0065,PTX Atlas / öko -"WIND-OFF,PEM-EL,CH3OHSYN",WIND-OFF,PEM-EL,CH3OHSYN,0.0338,PTX Atlas / öko -"WIND-OFF,PEM-EL,CH4SYN",WIND-OFF,PEM-EL,CH4SYN,0.0267,PTX Atlas / öko -"WIND-OFF,PEM-EL,DRI",WIND-OFF,PEM-EL,DRI,0.0267,PTX Atlas / öko -"WIND-OFF,PEM-EL,EFUELSYN",WIND-OFF,PEM-EL,EFUELSYN,0.0298,PTX Atlas / öko -"WIND-OFF,PEM-EL,LOHC-CON",WIND-OFF,PEM-EL,LOHC-CON,0.0267,PTX Atlas / öko -"WIND-OFF,PEM-EL,NH3SYN",WIND-OFF,PEM-EL,NH3SYN,0.0047,PTX Atlas / öko -"WIND-OFF,SOEC-EL,",WIND-OFF,SOEC-EL,,0.0068,PTX Atlas / öko -"WIND-OFF,SOEC-EL,CH3OHSYN",WIND-OFF,SOEC-EL,CH3OHSYN,0.0222,PTX Atlas / öko -"WIND-OFF,SOEC-EL,CH4SYN",WIND-OFF,SOEC-EL,CH4SYN,0.0187,PTX Atlas / öko -"WIND-OFF,SOEC-EL,DRI",WIND-OFF,SOEC-EL,DRI,0.0187,PTX Atlas / öko -"WIND-OFF,SOEC-EL,EFUELSYN",WIND-OFF,SOEC-EL,EFUELSYN,0.0223,PTX Atlas / öko -"WIND-OFF,SOEC-EL,LOHC-CON",WIND-OFF,SOEC-EL,LOHC-CON,0.0187,PTX Atlas / öko -"WIND-OFF,SOEC-EL,NH3SYN",WIND-OFF,SOEC-EL,NH3SYN,0.0047,PTX Atlas / öko -"WIND-ON,AEL-EL,",WIND-ON,AEL-EL,,0.0065,PTX Atlas / öko -"WIND-ON,AEL-EL,CH3OHSYN",WIND-ON,AEL-EL,CH3OHSYN,0.0338,PTX Atlas / öko -"WIND-ON,AEL-EL,CH4SYN",WIND-ON,AEL-EL,CH4SYN,0.0267,PTX Atlas / öko -"WIND-ON,AEL-EL,DRI",WIND-ON,AEL-EL,DRI,0.0267,PTX Atlas / öko -"WIND-ON,AEL-EL,EFUELSYN",WIND-ON,AEL-EL,EFUELSYN,0.0298,PTX Atlas / öko -"WIND-ON,AEL-EL,LOHC-CON",WIND-ON,AEL-EL,LOHC-CON,0.0267,PTX Atlas / öko -"WIND-ON,AEL-EL,NH3SYN",WIND-ON,AEL-EL,NH3SYN,0.0047,PTX Atlas / öko -"WIND-ON,PEM-EL,",WIND-ON,PEM-EL,,0.0065,PTX Atlas / öko -"WIND-ON,PEM-EL,CH3OHSYN",WIND-ON,PEM-EL,CH3OHSYN,0.0338,PTX Atlas / öko -"WIND-ON,PEM-EL,CH4SYN",WIND-ON,PEM-EL,CH4SYN,0.0267,PTX Atlas / öko -"WIND-ON,PEM-EL,DRI",WIND-ON,PEM-EL,DRI,0.0267,PTX Atlas / öko -"WIND-ON,PEM-EL,EFUELSYN",WIND-ON,PEM-EL,EFUELSYN,0.0298,PTX Atlas / öko -"WIND-ON,PEM-EL,LOHC-CON",WIND-ON,PEM-EL,LOHC-CON,0.0267,PTX Atlas / öko -"WIND-ON,PEM-EL,NH3SYN",WIND-ON,PEM-EL,NH3SYN,0.0047,PTX Atlas / öko -"WIND-ON,SOEC-EL,",WIND-ON,SOEC-EL,,0.0068,PTX Atlas / öko -"WIND-ON,SOEC-EL,CH3OHSYN",WIND-ON,SOEC-EL,CH3OHSYN,0.0222,PTX Atlas / öko -"WIND-ON,SOEC-EL,CH4SYN",WIND-ON,SOEC-EL,CH4SYN,0.0187,PTX Atlas / öko -"WIND-ON,SOEC-EL,DRI",WIND-ON,SOEC-EL,DRI,0.0187,PTX Atlas / öko -"WIND-ON,SOEC-EL,EFUELSYN",WIND-ON,SOEC-EL,EFUELSYN,0.0223,PTX Atlas / öko -"WIND-ON,SOEC-EL,LOHC-CON",WIND-ON,SOEC-EL,LOHC-CON,0.0187,PTX Atlas / öko -"WIND-ON,SOEC-EL,NH3SYN",WIND-ON,SOEC-EL,NH3SYN,0.0047,PTX Atlas / öko diff --git a/ptxboa/static/__init__.py b/ptxboa/static/__init__.py index 453785a2..18402fd7 100644 --- a/ptxboa/static/__init__.py +++ b/ptxboa/static/__init__.py @@ -544,7 +544,6 @@ "RE-POT", "SEASHARE", "SPECCOST", - "STR-CF", "WACC", ] ParameterCodeValues = [ @@ -564,7 +563,6 @@ "RE-POT", "SEASHARE", "SPECCOST", - "STR-CF", "WACC", ] @@ -586,7 +584,6 @@ "sea share of pipeline distance", "shipping distance", "specific costs", - "Storage cost factor", "transport capacity", ] ParameterNameValues = [ @@ -606,7 +603,6 @@ "sea share of pipeline distance", "shipping distance", "specific costs", - "Storage cost factor", "transport capacity", ] diff --git a/ptxboa/static/dim_parameter.csv b/ptxboa/static/dim_parameter.csv index a1bf1a1e..435d45aa 100644 --- a/ptxboa/static/dim_parameter.csv +++ b/ptxboa/static/dim_parameter.csv @@ -15,5 +15,4 @@ OPEX-T,levelized costs,USD2021/(kWh*km),False,False,True,False,True,False,False, RE-POT,RE potential,MWel,False,False,False,True,True,True,False,False,no,no,,process_code/source_region_code SEASHARE,sea share of pipeline distance,fraction,False,False,False,False,False,True,True,False,no,no,,source_region_code/target_country_code SPECCOST,specific costs,various (USD2021 per flow),True,False,False,False,False,True,False,True,basic,extended,"Costs are associated with every *secondary* input. It could also be associated with secondary output (<0 for gains, >0 for costs)",flow_code/source_region_code -STR-CF,Storage cost factor,1,False,True,False,True,False,False,False,False,0,0,, WACC,interest rate,fraction,False,True,False,True,False,True,False,True,,,,source_region_code diff --git a/tests/test_api.py b/tests/test_api.py index c7a4f3a6..d469af8a 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -108,7 +108,8 @@ def test_example_api_call_1_ship(self): ("Derivate production", "CAPEX"): 90.50895668682817, ("Derivate production", "OPEX"): 39.171320804334, ("Heat", "FLOW"): 277.3302192660863, - ("Electricity and H2 storage", "OPEX"): 176.3817106548646, + # ("Electricity and H2 storage", "OPEX"): 176.3817106548646, + # TODO: test data not up to date } result_dict = {k: pytest.approx(v) for k, v in res_values.items() if v} @@ -145,7 +146,8 @@ def test_example_api_call_2_ship_own_fuel(self): ("Derivate production", "CAPEX"): 188.2042202083766, ("Derivate production", "OPEX"): 37.0003810701601, ("Derivate production", "FLOW"): 16.8369286421993, - ("Electricity and H2 storage", "OPEX"): 40.72566174247268, + # ("Electricity and H2 storage", "OPEX"): 40.72566174247268, + # TODO: test data not up to date } result_dict = {k: pytest.approx(v) for k, v in res_values.items() if v} @@ -195,7 +197,7 @@ def test_example_api_call_3_pipeline_sea_land(self): ("Heat", "OPEX"): 0, ("Heat", "FLOW"): 0, ("Electricity and H2 storage", "CAPEX"): 0, - ("Electricity and H2 storage", "OPEX"): 2.060474611944337, + ("Electricity and H2 storage", "OPEX"): 0, # TODO: testdata is outdated ("Electricity and H2 storage", "FLOW"): 0, }.items(): self.assertAlmostEqual(res_values.get(k, 0), v, places=3, msg=k) @@ -243,7 +245,7 @@ def test_example_api_call_4_pipeline_retrofitted(self): ("Heat", "OPEX"): 0, ("Heat", "FLOW"): 0, ("Electricity and H2 storage", "CAPEX"): 0, - ("Electricity and H2 storage", "OPEX"): 1.968808488442095, + ("Electricity and H2 storage", "OPEX"): 0, # TODO: test data is outdated ("Electricity and H2 storage", "FLOW"): 0, }.items(): self.assertAlmostEqual(res_values.get(k, 0), v, places=3, msg=k) diff --git a/tests/test_api_data.py b/tests/test_api_data.py index 67c713c1..1214077a 100644 --- a/tests/test_api_data.py +++ b/tests/test_api_data.py @@ -308,7 +308,6 @@ def rec_approx(x): }, "parameter": { "WACC": 0.055673211551852, - "STR-CF": 0.0482, "CALOR": 33.33, "SPECCOST": { "BFUEL-L": 0.0027940534453652, @@ -465,7 +464,6 @@ def test_get_calculation_data_w_opt(ptxdata_dir, scenario, kwargs, request): }, "parameter": { "WACC": 0.1503103535592313, - "STR-CF": 0.0213, "CALOR": 33.33, "SPECCOST": { "BFUEL-L": 0.0027940534453652, diff --git a/tests/test_data/storage_cost_factor.csv b/tests/test_data/storage_cost_factor.csv deleted file mode 100644 index 87ba5cc5..00000000 --- a/tests/test_data/storage_cost_factor.csv +++ /dev/null @@ -1,106 +0,0 @@ -key,process_res,process_ely,process_deriv,value,source -"PV-FIX,AEL-EL,",PV-FIX,AEL-EL,,0.0959,PTX Atlas / öko -"PV-FIX,AEL-EL,CH3OHSYN",PV-FIX,AEL-EL,CH3OHSYN,0.0664,PTX Atlas / öko -"PV-FIX,AEL-EL,CH4SYN",PV-FIX,AEL-EL,CH4SYN,0.073,PTX Atlas / öko -"PV-FIX,AEL-EL,DRI",PV-FIX,AEL-EL,DRI,0.073,PTX Atlas / öko -"PV-FIX,AEL-EL,EFUELSYN",PV-FIX,AEL-EL,EFUELSYN,0.0631,PTX Atlas / öko -"PV-FIX,AEL-EL,LOHC-CON",PV-FIX,AEL-EL,LOHC-CON,0.073,PTX Atlas / öko -"PV-FIX,AEL-EL,NH3SYN",PV-FIX,AEL-EL,NH3SYN,0.0482,PTX Atlas / öko -"PV-FIX,PEM-EL,",PV-FIX,PEM-EL,,0.0959,PTX Atlas / öko -"PV-FIX,PEM-EL,CH3OHSYN",PV-FIX,PEM-EL,CH3OHSYN,0.0664,PTX Atlas / öko -"PV-FIX,PEM-EL,CH4SYN",PV-FIX,PEM-EL,CH4SYN,0.073,PTX Atlas / öko -"PV-FIX,PEM-EL,DRI",PV-FIX,PEM-EL,DRI,0.073,PTX Atlas / öko -"PV-FIX,PEM-EL,EFUELSYN",PV-FIX,PEM-EL,EFUELSYN,0.0631,PTX Atlas / öko -"PV-FIX,PEM-EL,LOHC-CON",PV-FIX,PEM-EL,LOHC-CON,0.073,PTX Atlas / öko -"PV-FIX,PEM-EL,NH3SYN",PV-FIX,PEM-EL,NH3SYN,0.0482,PTX Atlas / öko -"PV-FIX,SOEC-EL,",PV-FIX,SOEC-EL,,0.1027,PTX Atlas / öko -"PV-FIX,SOEC-EL,CH3OHSYN",PV-FIX,SOEC-EL,CH3OHSYN,0.4926,PTX Atlas / öko -"PV-FIX,SOEC-EL,CH4SYN",PV-FIX,SOEC-EL,CH4SYN,0.4649,PTX Atlas / öko -"PV-FIX,SOEC-EL,DRI",PV-FIX,SOEC-EL,DRI,0.4649,PTX Atlas / öko -"PV-FIX,SOEC-EL,EFUELSYN",PV-FIX,SOEC-EL,EFUELSYN,0.5156,PTX Atlas / öko -"PV-FIX,SOEC-EL,LOHC-CON",PV-FIX,SOEC-EL,LOHC-CON,0.4649,PTX Atlas / öko -"PV-FIX,SOEC-EL,NH3SYN",PV-FIX,SOEC-EL,NH3SYN,0.2427,PTX Atlas / öko -"PV-TRK,AEL-EL,",PV-TRK,AEL-EL,,0.0959,PTX Atlas / öko -"PV-TRK,AEL-EL,CH3OHSYN",PV-TRK,AEL-EL,CH3OHSYN,0.0664,PTX Atlas / öko -"PV-TRK,AEL-EL,CH4SYN",PV-TRK,AEL-EL,CH4SYN,0.073,PTX Atlas / öko -"PV-TRK,AEL-EL,DRI",PV-TRK,AEL-EL,DRI,0.073,PTX Atlas / öko -"PV-TRK,AEL-EL,EFUELSYN",PV-TRK,AEL-EL,EFUELSYN,0.0631,PTX Atlas / öko -"PV-TRK,AEL-EL,LOHC-CON",PV-TRK,AEL-EL,LOHC-CON,0.073,PTX Atlas / öko -"PV-TRK,AEL-EL,NH3SYN",PV-TRK,AEL-EL,NH3SYN,0.0482,PTX Atlas / öko -"PV-TRK,PEM-EL,",PV-TRK,PEM-EL,,0.0959,PTX Atlas / öko -"PV-TRK,PEM-EL,CH3OHSYN",PV-TRK,PEM-EL,CH3OHSYN,0.0664,PTX Atlas / öko -"PV-TRK,PEM-EL,CH4SYN",PV-TRK,PEM-EL,CH4SYN,0.073,PTX Atlas / öko -"PV-TRK,PEM-EL,DRI",PV-TRK,PEM-EL,DRI,0.073,PTX Atlas / öko -"PV-TRK,PEM-EL,EFUELSYN",PV-TRK,PEM-EL,EFUELSYN,0.0631,PTX Atlas / öko -"PV-TRK,PEM-EL,LOHC-CON",PV-TRK,PEM-EL,LOHC-CON,0.073,PTX Atlas / öko -"PV-TRK,PEM-EL,NH3SYN",PV-TRK,PEM-EL,NH3SYN,0.0482,PTX Atlas / öko -"PV-TRK,SOEC-EL,",PV-TRK,SOEC-EL,,0.1027,PTX Atlas / öko -"PV-TRK,SOEC-EL,CH3OHSYN",PV-TRK,SOEC-EL,CH3OHSYN,0.4926,PTX Atlas / öko -"PV-TRK,SOEC-EL,CH4SYN",PV-TRK,SOEC-EL,CH4SYN,0.4649,PTX Atlas / öko -"PV-TRK,SOEC-EL,DRI",PV-TRK,SOEC-EL,DRI,0.4649,PTX Atlas / öko -"PV-TRK,SOEC-EL,EFUELSYN",PV-TRK,SOEC-EL,EFUELSYN,0.5156,PTX Atlas / öko -"PV-TRK,SOEC-EL,LOHC-CON",PV-TRK,SOEC-EL,LOHC-CON,0.4649,PTX Atlas / öko -"PV-TRK,SOEC-EL,NH3SYN",PV-TRK,SOEC-EL,NH3SYN,0.2427,PTX Atlas / öko -"RES-HYBR,AEL-EL,",RES-HYBR,AEL-EL,,0.0384,PTX Atlas / öko -"RES-HYBR,AEL-EL,CH3OHSYN",RES-HYBR,AEL-EL,CH3OHSYN,0.0397,PTX Atlas / öko -"RES-HYBR,AEL-EL,CH4SYN",RES-HYBR,AEL-EL,CH4SYN,0.0391,PTX Atlas / öko -"RES-HYBR,AEL-EL,DRI",RES-HYBR,AEL-EL,DRI,0.0391,PTX Atlas / öko -"RES-HYBR,AEL-EL,EFUELSYN",RES-HYBR,AEL-EL,EFUELSYN,0.037,PTX Atlas / öko -"RES-HYBR,AEL-EL,LOHC-CON",RES-HYBR,AEL-EL,LOHC-CON,0.0391,PTX Atlas / öko -"RES-HYBR,AEL-EL,NH3SYN",RES-HYBR,AEL-EL,NH3SYN,0.0213,PTX Atlas / öko -"RES-HYBR,PEM-EL,",RES-HYBR,PEM-EL,,0.0384,PTX Atlas / öko -"RES-HYBR,PEM-EL,CH3OHSYN",RES-HYBR,PEM-EL,CH3OHSYN,0.0397,PTX Atlas / öko -"RES-HYBR,PEM-EL,CH4SYN",RES-HYBR,PEM-EL,CH4SYN,0.0391,PTX Atlas / öko -"RES-HYBR,PEM-EL,DRI",RES-HYBR,PEM-EL,DRI,0.0391,PTX Atlas / öko -"RES-HYBR,PEM-EL,EFUELSYN",RES-HYBR,PEM-EL,EFUELSYN,0.037,PTX Atlas / öko -"RES-HYBR,PEM-EL,LOHC-CON",RES-HYBR,PEM-EL,LOHC-CON,0.0391,PTX Atlas / öko -"RES-HYBR,PEM-EL,NH3SYN",RES-HYBR,PEM-EL,NH3SYN,0.0213,PTX Atlas / öko -"RES-HYBR,SOEC-EL,",RES-HYBR,SOEC-EL,,0.0431,PTX Atlas / öko -"RES-HYBR,SOEC-EL,CH3OHSYN",RES-HYBR,SOEC-EL,CH3OHSYN,0.1218,PTX Atlas / öko -"RES-HYBR,SOEC-EL,CH4SYN",RES-HYBR,SOEC-EL,CH4SYN,0.1209,PTX Atlas / öko -"RES-HYBR,SOEC-EL,DRI",RES-HYBR,SOEC-EL,DRI,0.1209,PTX Atlas / öko -"RES-HYBR,SOEC-EL,EFUELSYN",RES-HYBR,SOEC-EL,EFUELSYN,0.1274,PTX Atlas / öko -"RES-HYBR,SOEC-EL,LOHC-CON",RES-HYBR,SOEC-EL,LOHC-CON,0.1209,PTX Atlas / öko -"RES-HYBR,SOEC-EL,NH3SYN",RES-HYBR,SOEC-EL,NH3SYN,0.0907,PTX Atlas / öko -"WIND-OFF,AEL-EL,",WIND-OFF,AEL-EL,,0.0065,PTX Atlas / öko -"WIND-OFF,AEL-EL,CH3OHSYN",WIND-OFF,AEL-EL,CH3OHSYN,0.0338,PTX Atlas / öko -"WIND-OFF,AEL-EL,CH4SYN",WIND-OFF,AEL-EL,CH4SYN,0.0267,PTX Atlas / öko -"WIND-OFF,AEL-EL,DRI",WIND-OFF,AEL-EL,DRI,0.0267,PTX Atlas / öko -"WIND-OFF,AEL-EL,EFUELSYN",WIND-OFF,AEL-EL,EFUELSYN,0.0298,PTX Atlas / öko -"WIND-OFF,AEL-EL,LOHC-CON",WIND-OFF,AEL-EL,LOHC-CON,0.0267,PTX Atlas / öko -"WIND-OFF,AEL-EL,NH3SYN",WIND-OFF,AEL-EL,NH3SYN,0.0047,PTX Atlas / öko -"WIND-OFF,PEM-EL,",WIND-OFF,PEM-EL,,0.0065,PTX Atlas / öko -"WIND-OFF,PEM-EL,CH3OHSYN",WIND-OFF,PEM-EL,CH3OHSYN,0.0338,PTX Atlas / öko -"WIND-OFF,PEM-EL,CH4SYN",WIND-OFF,PEM-EL,CH4SYN,0.0267,PTX Atlas / öko -"WIND-OFF,PEM-EL,DRI",WIND-OFF,PEM-EL,DRI,0.0267,PTX Atlas / öko -"WIND-OFF,PEM-EL,EFUELSYN",WIND-OFF,PEM-EL,EFUELSYN,0.0298,PTX Atlas / öko -"WIND-OFF,PEM-EL,LOHC-CON",WIND-OFF,PEM-EL,LOHC-CON,0.0267,PTX Atlas / öko -"WIND-OFF,PEM-EL,NH3SYN",WIND-OFF,PEM-EL,NH3SYN,0.0047,PTX Atlas / öko -"WIND-OFF,SOEC-EL,",WIND-OFF,SOEC-EL,,0.0068,PTX Atlas / öko -"WIND-OFF,SOEC-EL,CH3OHSYN",WIND-OFF,SOEC-EL,CH3OHSYN,0.0222,PTX Atlas / öko -"WIND-OFF,SOEC-EL,CH4SYN",WIND-OFF,SOEC-EL,CH4SYN,0.0187,PTX Atlas / öko -"WIND-OFF,SOEC-EL,DRI",WIND-OFF,SOEC-EL,DRI,0.0187,PTX Atlas / öko -"WIND-OFF,SOEC-EL,EFUELSYN",WIND-OFF,SOEC-EL,EFUELSYN,0.0223,PTX Atlas / öko -"WIND-OFF,SOEC-EL,LOHC-CON",WIND-OFF,SOEC-EL,LOHC-CON,0.0187,PTX Atlas / öko -"WIND-OFF,SOEC-EL,NH3SYN",WIND-OFF,SOEC-EL,NH3SYN,0.0047,PTX Atlas / öko -"WIND-ON,AEL-EL,",WIND-ON,AEL-EL,,0.0065,PTX Atlas / öko -"WIND-ON,AEL-EL,CH3OHSYN",WIND-ON,AEL-EL,CH3OHSYN,0.0338,PTX Atlas / öko -"WIND-ON,AEL-EL,CH4SYN",WIND-ON,AEL-EL,CH4SYN,0.0267,PTX Atlas / öko -"WIND-ON,AEL-EL,DRI",WIND-ON,AEL-EL,DRI,0.0267,PTX Atlas / öko -"WIND-ON,AEL-EL,EFUELSYN",WIND-ON,AEL-EL,EFUELSYN,0.0298,PTX Atlas / öko -"WIND-ON,AEL-EL,LOHC-CON",WIND-ON,AEL-EL,LOHC-CON,0.0267,PTX Atlas / öko -"WIND-ON,AEL-EL,NH3SYN",WIND-ON,AEL-EL,NH3SYN,0.0047,PTX Atlas / öko -"WIND-ON,PEM-EL,",WIND-ON,PEM-EL,,0.0065,PTX Atlas / öko -"WIND-ON,PEM-EL,CH3OHSYN",WIND-ON,PEM-EL,CH3OHSYN,0.0338,PTX Atlas / öko -"WIND-ON,PEM-EL,CH4SYN",WIND-ON,PEM-EL,CH4SYN,0.0267,PTX Atlas / öko -"WIND-ON,PEM-EL,DRI",WIND-ON,PEM-EL,DRI,0.0267,PTX Atlas / öko -"WIND-ON,PEM-EL,EFUELSYN",WIND-ON,PEM-EL,EFUELSYN,0.0298,PTX Atlas / öko -"WIND-ON,PEM-EL,LOHC-CON",WIND-ON,PEM-EL,LOHC-CON,0.0267,PTX Atlas / öko -"WIND-ON,PEM-EL,NH3SYN",WIND-ON,PEM-EL,NH3SYN,0.0047,PTX Atlas / öko -"WIND-ON,SOEC-EL,",WIND-ON,SOEC-EL,,0.0068,PTX Atlas / öko -"WIND-ON,SOEC-EL,CH3OHSYN",WIND-ON,SOEC-EL,CH3OHSYN,0.0222,PTX Atlas / öko -"WIND-ON,SOEC-EL,CH4SYN",WIND-ON,SOEC-EL,CH4SYN,0.0187,PTX Atlas / öko -"WIND-ON,SOEC-EL,DRI",WIND-ON,SOEC-EL,DRI,0.0187,PTX Atlas / öko -"WIND-ON,SOEC-EL,EFUELSYN",WIND-ON,SOEC-EL,EFUELSYN,0.0223,PTX Atlas / öko -"WIND-ON,SOEC-EL,LOHC-CON",WIND-ON,SOEC-EL,LOHC-CON,0.0187,PTX Atlas / öko -"WIND-ON,SOEC-EL,NH3SYN",WIND-ON,SOEC-EL,NH3SYN,0.0047,PTX Atlas / öko