From e459c3c89d11a7ff159de97718ce2807b689d27a Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Fri, 15 Mar 2024 14:28:01 +0100 Subject: [PATCH] add release notes; rename artificial to synthetic --- config/config.default.yaml | 2 +- doc/configtables/load.csv | 2 +- doc/release_notes.rst | 46 +++++++++++++++++++++++++++++ doc/sector.rst | 5 ++++ rules/build_electricity.smk | 6 ++-- rules/retrieve.smk | 6 ++-- scripts/build_electricity_demand.py | 12 ++++---- 7 files changed, 65 insertions(+), 14 deletions(-) diff --git a/config/config.default.yaml b/config/config.default.yaml index da2e20f1..a8cd195c 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -292,7 +292,7 @@ load: manual_adjustments: true # false scaling_factor: 1.0 fixed_year: false # false or year (e.g. 2013) - supplement_missing_data_artificially: true + supplement_synthetic: true # docs # TODO: PyPSA-Eur merge issue in prepare_sector_network.py diff --git a/doc/configtables/load.csv b/doc/configtables/load.csv index 02e7b97b..34d73dc5 100644 --- a/doc/configtables/load.csv +++ b/doc/configtables/load.csv @@ -4,4 +4,4 @@ time_shift_for_large_gaps,string,string,"Periods which are used for copying time manual_adjustments,bool,"{true, false}","Whether to adjust the load data manually according to the function in :func:`manual_adjustment`." scaling_factor,--,float,"Global correction factor for the load time series." fixed_year,--,Year or False,"To specify a fixed year for the load time series that deviates from the snapshots' year" -supplement_missing_data_artificially,bool,"{true, false}","Whether to supplement missing data for selected time period should be supplemented by artificial data from https://zenodo.org/record/7070438/files/demand_hourly.csv." +supplement_synthetic,bool,"{true, false}","Whether to supplement missing data for selected time period should be supplemented by synthetic data from https://zenodo.org/record/10820928." diff --git a/doc/release_notes.rst b/doc/release_notes.rst index ad1bbf4f..a5cb9273 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -10,6 +10,52 @@ Release Notes Upcoming Release ================ +* Enhanced support for choosing different weather years + (https://github.com/PyPSA/pypsa-eur/pull/204): + + - Processed energy statistics from eurostat (1990-2021) and IDEES (2000-2015) + are now initially stored for all available years and filtered by the year + given in ``energy: energy_totals_year:``. + + - Added option to supplement electricity load data with synthetic time series + for years not contained in OPSD (from https://zenodo.org/records/10820928, + ``load: supplement_synthetic:``). + + - The total annual heat demand for years not contained in the energy + statistics by eurostat (1990-2021) or IDEES (2000-2015) are scaled based on + a regression between the total number of heating degree days and the total + annual heat demand between the years 2007-2021, assuming a similar building + stock. + + - Added option to scale annual hydro-electricity generation data for years not + contained in the in EIA (1980-2021) based on a regression between annual + generation and total runoff per country for the years 1980-2021 + (``renewable: hydro: eia_approximate_missing:``) + + - Added option to normalize annual hydro generation data by the associated + installed capacity reported by EIA (1980-2021) in order to eliminate changes + in generation due to newly built capacity (``renewable: hydro: + eia_approximate_missing: eia_correct_by_capacity:``). + + - Added option to make hydro generation data independent of weather year + (``renewable: hydro: eia_approximate_missing: eia_norm_year:``). + + - Added option to drop leap days (``enable: drop_leap_day:``). + + - Added option to make electric load data independent of weather year + (``load: fixed_year:``). + + - Include time series of Swiss number of passenger vehicles from the `Swiss + Federal Statistical Office + `_. + + - Updated hydro-electricity generation and capacity data from EIA. + + - The easiest way to sweep over multiple weather years is to use the new + scenario management. An example for the necessary `create_scenarios.py` + script can be found in this `Github gist + `_. + * Upgrade to Snakemake v8.5+. This version is the new minimum version required. To upgrade an existing environment, run ``conda install -c bioconda snakemake-minimal">=8.5"`` and ``pip install snakemake-storage-plugin-http`` diff --git a/doc/sector.rst b/doc/sector.rst index 84a5fdc9..7a04a580 100644 --- a/doc/sector.rst +++ b/doc/sector.rst @@ -56,6 +56,11 @@ Rule ``build_energy_totals`` .. automodule:: build_energy_totals +Rule ``build_heat_totals`` +============================================================================== + +.. automodule:: build_heat_totals + Rule ``build_gas_input_locations`` ============================================================================== diff --git a/rules/build_electricity.smk b/rules/build_electricity.smk index 2b4d9af6..f84a9969 100644 --- a/rules/build_electricity.smk +++ b/rules/build_electricity.smk @@ -26,9 +26,9 @@ rule build_electricity_demand: load=config_provider("load"), input: reported=ancient("data/electricity_demand_raw.csv"), - artificial=lambda w: ( - ancient("data/load_artificial_raw.csv") - if config_provider("load", "supplement_missing_data_artificially")(w) + synthetic=lambda w: ( + ancient("data/load_synthetic_raw.csv") + if config_provider("load", "supplement_synthetic")(w) else [] ), output: diff --git a/rules/retrieve.smk b/rules/retrieve.smk index 0a7cdf6a..b2c1e8d6 100644 --- a/rules/retrieve.smk +++ b/rules/retrieve.smk @@ -196,15 +196,15 @@ if config["enable"]["retrieve"]: if config["enable"]["retrieve"]: - rule retrieve_artificial_load_data: + rule retrieve_synthetic_electricity_demand: input: storage( "https://zenodo.org/records/10820928/files/demand_hourly.csv", ), output: - "data/load_artificial_raw.csv", + "data/load_synthetic_raw.csv", log: - "logs/retrieve_artificial_load_data.log", + "logs/retrieve_synthetic_electricity_demand.log", resources: mem_mb=5000, retries: 2 diff --git a/scripts/build_electricity_demand.py b/scripts/build_electricity_demand.py index 8d61e770..9174672d 100755 --- a/scripts/build_electricity_demand.py +++ b/scripts/build_electricity_demand.py @@ -307,12 +307,12 @@ if __name__ == "__main__": ) load = load.apply(fill_large_gaps, shift=time_shift) - if snakemake.params.load["supplement_missing_data_artificially"]: - logger.info("Supplement missing data with artificial data.") - fn = snakemake.input.artificial - artificial_load = pd.read_csv(fn, index_col=0, parse_dates=True) - artificial_load = artificial_load.loc[snapshots, countries] - load = load.combine_first(artificial_load) + if snakemake.params.load["supplement_synthetic"]: + logger.info("Supplement missing data with synthetic data.") + fn = snakemake.input.synthetic + synthetic_load = pd.read_csv(fn, index_col=0, parse_dates=True) + synthetic_load = synthetic_load.loc[snapshots, countries] + load = load.combine_first(synthetic_load) assert not load.isna().any().any(), ( "Load data contains nans. Adjust the parameters "