diff --git a/doc/release_notes.rst b/doc/release_notes.rst index ee7bd64b..fce4ae1b 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -10,6 +10,9 @@ Release Notes Upcoming Release ================ +* 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 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 diff --git a/rules/build_electricity.smk b/rules/build_electricity.smk index ba11f060..f05e18c0 100644 --- a/rules/build_electricity.smk +++ b/rules/build_electricity.smk @@ -24,9 +24,9 @@ rule build_electricity_demand: countries=config["countries"], load=config["load"], input: - ancient(RESOURCES + "electricity_demand.csv"), + ancient("data/electricity_demand_raw.csv"), output: - RESOURCES + "load.csv", + RESOURCES + "electricity_demand.csv", log: LOGS + "build_electricity_demand.log", resources: @@ -417,7 +417,7 @@ rule add_electricity: if config["conventional"]["dynamic_fuel_price"] else [] ), - load=RESOURCES + "load.csv", + load=RESOURCES + "electricity_demand.csv", nuts3_shapes=RESOURCES + "nuts3_shapes.geojson", ua_md_gdp="data/GDP_PPP_30arcsec_v3_mapped_default.csv", output: diff --git a/rules/retrieve.smk b/rules/retrieve.smk index 0821a6b7..acb8a1c1 100644 --- a/rules/retrieve.smk +++ b/rules/retrieve.smk @@ -191,7 +191,7 @@ if config["enable"]["retrieve"]: params: versions=["2019-06-05", "2020-10-06"], output: - RESOURCES + "electricity_demand.csv", + "data/electricity_demand_raw.csv", log: LOGS + "retrieve_electricity_demand.log", resources: diff --git a/scripts/add_electricity.py b/scripts/add_electricity.py index ab97dcd0..614e3330 100755 --- a/scripts/add_electricity.py +++ b/scripts/add_electricity.py @@ -52,7 +52,7 @@ Inputs :scale: 34 % - ``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/nuts3_shapes.geojson``: confer :ref:`shapes` - ``resources/powerplants.csv``: confer :ref:`powerplants` diff --git a/scripts/build_electricity_demand.py b/scripts/build_electricity_demand.py index d708cf6f..5d013065 100755 --- a/scripts/build_electricity_demand.py +++ b/scripts/build_electricity_demand.py @@ -1,15 +1,13 @@ # -*- 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 """ -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 `_. For all countries in -the network, the per country load timeseries with suffix -``_load_actual_entsoe_transparency`` are extracted from the dataset. After -filling small gaps linearly and large gaps by copying time-slice of a given -period, the load data is exported to a ``.csv`` file. +the network, the per country load timeseries are extracted from the dataset. +After filling small gaps linearly and large gaps by copying time-slice of a +given period, the load data is exported to a ``.csv`` file. Relevant Settings ----------------- @@ -19,9 +17,7 @@ Relevant Settings snapshots: load: - interpolate_limit: - time_shift_for_large_gaps: - manual_adjustments: + interpolate_limit: time_shift_for_large_gaps: manual_adjustments: .. seealso:: @@ -31,12 +27,12 @@ Relevant Settings Inputs ------ -- ``resources/electricity_demand.csv``: +- ``data/electricity_demand_raw.csv``: Outputs ------- -- ``resources/load.csv``: +- ``resources/electricity_demand.csv``: """ import logging @@ -141,7 +137,7 @@ def copy_timeslice(load, cntry, start, stop, delta, fn_load=None): ].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. @@ -262,7 +258,7 @@ if __name__ == "__main__": if "snakemake" not in globals(): from _helpers import mock_snakemake - snakemake = mock_snakemake("build_electricity_demand", run="network2019") + snakemake = mock_snakemake("build_electricity_demand") configure_logging(snakemake) @@ -289,7 +285,7 @@ if __name__ == "__main__": load["MD"] = 6.2e6 * (load_ua / load_ua.sum()) if snakemake.params.load["manual_adjustments"]: - load = manual_adjustment(load, snakemake.input[0]) + load = manual_adjustment(load, snakemake.input[0], countries) if load.empty: logger.warning("Build electricity demand time series is empty.") diff --git a/scripts/retrieve_electricity_demand.py b/scripts/retrieve_electricity_demand.py index 01dc4aa8..a8a44b68 100644 --- a/scripts/retrieve_electricity_demand.py +++ b/scripts/retrieve_electricity_demand.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -# SPDX-FileCopyrightText: : 2023 The PyPSA-Eur Authors +# SPDX-FileCopyrightText: 2023-2024 The PyPSA-Eur Authors # # SPDX-License-Identifier: MIT """ -Retrieve monthly fuel prices from Destatis. +Retrieve electricity prices from OPSD. """ import logging @@ -12,9 +12,7 @@ import pandas as pd logger = logging.getLogger(__name__) -from pathlib import Path - -from _helpers import configure_logging, set_scenario_config +from _helpers import configure_logging if __name__ == "__main__": if "snakemake" not in globals(): @@ -25,7 +23,6 @@ if __name__ == "__main__": else: rootpath = "." configure_logging(snakemake) - set_scenario_config(snakemake) url = "https://data.open-power-system-data.org/time_series/{version}/time_series_60min_singleindex.csv"