diff --git a/environment.yaml b/environment.yaml index 90367fae..2c60dc52 100644 --- a/environment.yaml +++ b/environment.yaml @@ -46,4 +46,4 @@ dependencies: - git+https://github.com/PyPSA/glaes.git#egg=glaes - git+https://github.com/PyPSA/geokit.git#egg=geokit - cdsapi - - powerplantmatching + - powerplantmatching>=0.4.2 diff --git a/scripts/add_electricity.py b/scripts/add_electricity.py index e963e050..cd1a5a82 100644 --- a/scripts/add_electricity.py +++ b/scripts/add_electricity.py @@ -577,6 +577,11 @@ def add_emission_prices(n, emission_prices=None, exclude_co2=False): n.generators['marginal_cost'] += n.generators.carrier.map(ep) n.storage_units['marginal_cost'] += n.storage_units.carrier.map(ep) +def add_nice_carrier_names(n): + nice_names = pd.Series(snakemake.config['plotting']['nice_names']) + n.carriers['nice_names'] = nice_names[n.carriers.index] + + if __name__ == "__main__": # Detect running outside of snakemake and mock snakemake for testing if 'snakemake' not in globals(): @@ -615,5 +620,6 @@ if __name__ == "__main__": attach_storage(n, costs) estimate_renewable_capacities(n) + add_nice_carrier_names(n) n.export_to_netcdf(snakemake.output[0]) diff --git a/scripts/build_powerplants.py b/scripts/build_powerplants.py index 6735e7fc..6d52a440 100644 --- a/scripts/build_powerplants.py +++ b/scripts/build_powerplants.py @@ -1,6 +1,6 @@ # coding: utf-8 """ -Retrieves conventional powerplant capacities and locations from `powerplantmatching `_, assigns these to buses and creates a ``.csv`` file. It is possible to amend the powerplant database with custom entries provided in ``data/custom_powerplants.csv``. +Retrieves conventional powerplant capacities and locations from `powerplantmatching `_, assigns these to buses and creates a ``.csv`` file. It is possible to amend the powerplant database with custom entries provided in ``data/custom_powerplants.csv``. Relevant Settings ----------------- @@ -50,7 +50,7 @@ The configuration options ``electricity: powerplants_filter`` and ``electricity: powerplants_filter: Country not in ['Germany'] custom_powerplants: true - or + or .. code:: yaml @@ -103,6 +103,7 @@ if __name__ == "__main__": countries = n.buses.country.unique() ppl = (pm.powerplants(from_url=True) + .powerplant.fill_missing_decommyears() .powerplant.convert_country_to_alpha2() .query('Fueltype not in ["Solar", "Wind"] and Country in @countries') .replace({'Technology': {'Steam Turbine': 'OCGT'}})