Adaptations to match current PyPSA-Eur version

This commit is contained in:
Fabian Neumann 2022-06-27 10:21:08 +02:00 committed by GitHub
parent 520f7e440e
commit 9c6c6d243f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 29 deletions

View File

@ -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:

View File

@ -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

View File

@ -7,9 +7,9 @@
Cost Assumptions
##################
The database of cost assumptions is retrieved from the repository `PyPSA/technology-data <https://github.com/pypsa/technology-data>`_ and then saved to``resources/costs.csv``.
The database of cost assumptions is retrieved from the repository `PyPSA/technology-data <https://github.com/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

View File

@ -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'):

View File

@ -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):

View File

@ -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