Merge branch 'master' into scenario-management

This commit is contained in:
Fabian Neumann 2024-02-12 10:59:37 +01:00
commit 6b013dbd40
7 changed files with 22 additions and 26 deletions

View File

@ -17,6 +17,9 @@ Upcoming Release
names to run under ``run: name:`` in the configuration file. The latter must names to run under ``run: name:`` in the configuration file. The latter must
be a subset of toplevel keys in the scenario file. be a subset of toplevel keys in the scenario file.
* Merged two OPSD time series data versions into such that the option ``load:
power_statistics:`` becomes superfluous and was hence removed.
* Add new default to overdimension heating in individual buildings. This allows * Add new default to overdimension heating in individual buildings. This allows
them to cover heat demand peaks e.g. 10% higher than those in the data. The them to cover heat demand peaks e.g. 10% higher than those in the data. The
disadvantage of manipulating the costs is that the capacity is then not quite disadvantage of manipulating the costs is that the capacity is then not quite

View File

@ -91,7 +91,7 @@ None.
**Outputs** **Outputs**
- ``data/electricity_demand.csv`` - ``data/electricity_demand_raw.csv``
Rule ``retrieve_cost_data`` Rule ``retrieve_cost_data``

View File

@ -26,9 +26,9 @@ rule build_electricity_demand:
countries=config_provider("countries"), countries=config_provider("countries"),
load=config_provider("load"), load=config_provider("load"),
input: input:
ancient("data/electricity_demand.csv"), ancient("data/electricity_demand_raw.csv"),
output: output:
resources("load.csv"), resources("electricity_demand.csv"),
log: log:
logs("build_electricity_demand.log"), logs("build_electricity_demand.log"),
resources: resources:
@ -435,7 +435,7 @@ rule add_electricity:
if config_provider("conventional", "dynamic_fuel_price") if config_provider("conventional", "dynamic_fuel_price")
else [] else []
), ),
load=resources("load.csv"), load=resources("electricity_demand.csv"),
nuts3_shapes=resources("nuts3_shapes.geojson"), nuts3_shapes=resources("nuts3_shapes.geojson"),
ua_md_gdp="data/GDP_PPP_30arcsec_v3_mapped_default.csv", ua_md_gdp="data/GDP_PPP_30arcsec_v3_mapped_default.csv",
output: output:

View File

@ -191,7 +191,7 @@ if config["enable"]["retrieve"]:
params: params:
versions=["2019-06-05", "2020-10-06"], versions=["2019-06-05", "2020-10-06"],
output: output:
"data/electricity_demand.csv", "data/electricity_demand_raw.csv",
log: log:
"logs/retrieve_electricity_demand.log", "logs/retrieve_electricity_demand.log",
resources: resources:

View File

@ -52,7 +52,7 @@ Inputs
:scale: 34 % :scale: 34 %
- ``data/geth2015_hydro_capacities.csv``: alternative to capacities above; not currently used! - ``data/geth2015_hydro_capacities.csv``: alternative to capacities above; not currently used!
- ``resources/load.csv`` Hourly per-country load profiles. - ``resources/electricity_demand.csv`` Hourly per-country electricity demand profiles.
- ``resources/regions_onshore.geojson``: confer :ref:`busregions` - ``resources/regions_onshore.geojson``: confer :ref:`busregions`
- ``resources/nuts3_shapes.geojson``: confer :ref:`shapes` - ``resources/nuts3_shapes.geojson``: confer :ref:`shapes`
- ``resources/powerplants.csv``: confer :ref:`powerplants` - ``resources/powerplants.csv``: confer :ref:`powerplants`

View File

@ -1,15 +1,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: : 2020 @JanFrederickUnnewehr, The PyPSA-Eur Authors # SPDX-FileCopyrightText: : 2020 @JanFrederickUnnewehr, 2020-2024 The PyPSA-Eur Authors
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
""" """
This rule downloads the load data from `Open Power System Data Time series. This rule downloads the load data from `Open Power System Data Time series
<https://data.open-power-system-data.org/time_series/>`_. For all countries in <https://data.open-power-system-data.org/time_series/>`_. For all countries in
the network, the per country load timeseries with suffix the network, the per country load timeseries are extracted from the dataset.
``_load_actual_entsoe_transparency`` are extracted from the dataset. After After filling small gaps linearly and large gaps by copying time-slice of a
filling small gaps linearly and large gaps by copying time-slice of a given given period, the load data is exported to a ``.csv`` file.
period, the load data is exported to a ``.csv`` file.
Relevant Settings Relevant Settings
----------------- -----------------
@ -19,9 +17,7 @@ Relevant Settings
snapshots: snapshots:
load: load:
interpolate_limit: interpolate_limit: time_shift_for_large_gaps: manual_adjustments:
time_shift_for_large_gaps:
manual_adjustments:
.. seealso:: .. seealso::
@ -31,12 +27,12 @@ Relevant Settings
Inputs Inputs
------ ------
- ``data/electricity_demand.csv``: - ``data/electricity_demand_raw.csv``:
Outputs Outputs
------- -------
- ``resources/load.csv``: - ``resources/electricity_demand.csv``:
""" """
import logging import logging
@ -141,7 +137,7 @@ def copy_timeslice(load, cntry, start, stop, delta, fn_load=None):
].values ].values
def manual_adjustment(load, fn_load): def manual_adjustment(load, fn_load, countries):
""" """
Adjust gaps manual for load data from OPSD time-series package. Adjust gaps manual for load data from OPSD time-series package.
@ -290,7 +286,7 @@ if __name__ == "__main__":
load["MD"] = 6.2e6 * (load_ua / load_ua.sum()) load["MD"] = 6.2e6 * (load_ua / load_ua.sum())
if snakemake.params.load["manual_adjustments"]: if snakemake.params.load["manual_adjustments"]:
load = manual_adjustment(load, snakemake.input[0]) load = manual_adjustment(load, snakemake.input[0], countries)
if load.empty: if load.empty:
logger.warning("Build electricity demand time series is empty.") logger.warning("Build electricity demand time series is empty.")

View File

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: : 2023 The PyPSA-Eur Authors # SPDX-FileCopyrightText: 2023-2024 The PyPSA-Eur Authors
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
""" """
Retrieve monthly fuel prices from Destatis. Retrieve electricity prices from OPSD.
""" """
import logging import logging
@ -12,9 +12,7 @@ import pandas as pd
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
from pathlib import Path from _helpers import configure_logging
from _helpers import configure_logging, set_scenario_config
if __name__ == "__main__": if __name__ == "__main__":
if "snakemake" not in globals(): if "snakemake" not in globals():
@ -25,7 +23,6 @@ if __name__ == "__main__":
else: else:
rootpath = "." rootpath = "."
configure_logging(snakemake) configure_logging(snakemake)
set_scenario_config(snakemake)
url = "https://data.open-power-system-data.org/time_series/{version}/time_series_60min_singleindex.csv" url = "https://data.open-power-system-data.org/time_series/{version}/time_series_60min_singleindex.csv"