diff --git a/Snakefile b/Snakefile index f4ee4c2b..ad50ff97 100644 --- a/Snakefile +++ b/Snakefile @@ -173,9 +173,9 @@ if config['enable'].get('retrieve_cost_data', True): params: year = config['costs']['year'], version = config['costs']['version'], - input: HTTP.remote("raw.githubusercontent.com/PyPSA/technology-data/{params.version}/outputs/costs_{params.year}.csv", keep_local=True) + input: HTTP.remote(f"raw.githubusercontent.com/PyPSA/technology-data/{params.version}/outputs/costs_{params.year}.csv", keep_local=True) output: COSTS - shell: 'mv {input} {output}' + run: move(input[0], output[0]) rule build_renewable_profiles: input: diff --git a/config.tutorial.yaml b/config.tutorial.yaml index 89f04324..ecfeff6b 100755 --- a/config.tutorial.yaml +++ b/config.tutorial.yaml @@ -159,7 +159,7 @@ load: costs: year: 2030 version: v0.1.0 - rooftop_share: 0.5 + rooftop_share: 0.14 fill_values: FOM: 0 VOM: 0 diff --git a/doc/costs.rst b/doc/costs.rst index f56e40d3..ef0b4d37 100644 --- a/doc/costs.rst +++ b/doc/costs.rst @@ -7,9 +7,9 @@ Cost Assumptions ################## -The database of cost assumptions is retrieved from the repository `PyPSA/technology-data `_ and then saved to``resources/costs.csv``. +The database of cost assumptions is retrieved from the repository `PyPSA/technology-data `_ and then saved to``resources/costs.csv``. Cost assumptions of previous PyPSA-Eur versions can be restored by setting in the ``Snakefile``: ``COSTS="data/costs.csv". -The ``config.yaml` provides options to choose a reference year (``costs: year:``) and use a specific version of the repository ``costs: version:``. +The ``config.yaml`` provides options to choose a reference year (``costs: year:``) and use a specific version of the repository ``costs: version:``. It includes cost assumptions for all included technologies for specific years from various sources, namely for diff --git a/scripts/add_electricity.py b/scripts/add_electricity.py index c0701c6f..5351bba9 100755 --- a/scripts/add_electricity.py +++ b/scripts/add_electricity.py @@ -169,7 +169,7 @@ def load_costs(tech_costs, config, elec_config, Nyears=1.): costs_for_storage(costs.loc["battery storage"], costs.loc["battery inverter"], max_hours=max_hours['battery']) costs.loc["H2"] = \ - costs_for_storage(costs.loc["hydrogen storage tank"], costs.loc["fuel cell"], + costs_for_storage(costs.loc["hydrogen storage underground"], costs.loc["fuel cell"], costs.loc["electrolysis"], max_hours=max_hours['H2']) for attr in ('marginal_cost', 'capital_cost'): diff --git a/scripts/add_extra_components.py b/scripts/add_extra_components.py index 72e90e3b..bf5c4175 100644 --- a/scripts/add_extra_components.py +++ b/scripts/add_extra_components.py @@ -76,28 +76,19 @@ def attach_storageunits(n, costs, elec_opts): lookup_dispatch = {"H2": "fuel cell", "battery": "battery inverter"} for carrier in carriers: - if carrier=="battery": - n.madd("StorageUnit", buses_i, ' ' + carrier, - bus=buses_i, - carrier=carrier, - p_nom_extendable=True, - capital_cost=costs.at[carrier, 'capital_cost'], - marginal_cost=costs.at[carrier, 'marginal_cost'], - efficiency_store=costs.at[lookup_store[carrier], 'efficiency']**0.5, - efficiency_dispatch=costs.at[lookup_dispatch[carrier], 'efficiency']**0.5, - max_hours=max_hours[carrier], - cyclic_state_of_charge=True) - else: - n.madd("StorageUnit", buses_i, ' ' + carrier, - bus=buses_i, - carrier=carrier, - p_nom_extendable=True, - capital_cost=costs.at[carrier, 'capital_cost'], - marginal_cost=costs.at[carrier, 'marginal_cost'], - efficiency_store=costs.at[lookup_store[carrier], 'efficiency'], - efficiency_dispatch=costs.at[lookup_dispatch[carrier], 'efficiency'], - max_hours=max_hours[carrier], - cyclic_state_of_charge=True) + roundtrip_correction = 0.5 if carrier == "battery" else 1 + + n.madd("StorageUnit", buses_i, ' ' + carrier, + bus=buses_i, + carrier=carrier, + p_nom_extendable=True, + capital_cost=costs.at[carrier, 'capital_cost'], + marginal_cost=costs.at[carrier, 'marginal_cost'], + efficiency_store=costs.at[lookup_store[carrier], 'efficiency']**roundtrip_correction, + efficiency_dispatch=costs.at[lookup_dispatch[carrier], 'efficiency']**roundtrip_correction, + max_hours=max_hours[carrier], + cyclic_state_of_charge=True + ) def attach_stores(n, costs, elec_opts): diff --git a/test/config.test1.yaml b/test/config.test1.yaml index 2a6bb26a..efd2bc12 100755 --- a/test/config.test1.yaml +++ b/test/config.test1.yaml @@ -157,7 +157,7 @@ load: costs: year: 2030 version: v0.1.0 - rooftop_share: 0.5 + rooftop_share: 0.14 fill_values: FOM: 0 VOM: 0