Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4b8f2a2
feat: add configuration for pecd fill_gaps_method for missing data
daniel-rdt Jul 11, 2025
1224c36
feat: add SolarPV for utility and rooftop with differentiation
daniel-rdt Jul 14, 2025
d501597
fix: adjust config name of solar-pv carrier
daniel-rdt Jul 15, 2025
89a89ad
fix: make LFSolarPV import more generic to differentiation of more nodes
daniel-rdt Jul 15, 2025
148b508
feat: add Exception if no input data for specified PECD tech
daniel-rdt Jul 15, 2025
265b6ac
feat: add onshore wind to tyndp renewable carriers and pecd profiles
daniel-rdt Jul 15, 2025
6afdd2c
fix: check in add existing renwables in case non of the specified car…
daniel-rdt Jul 16, 2025
de41c1b
fix: add back onwind and solar to renewable carriers until tyndp carr…
daniel-rdt Jul 16, 2025
67e2d99
feat: Slightly improve value error message
daniel-rdt Jul 30, 2025
b487dde
feat: add todo for redundant renewable carriers
daniel-rdt Jul 30, 2025
f80ac54
feat: custom fix for skiprows and typo
daniel-rdt Jul 30, 2025
7793eb7
feat: add collect rules for clean_pecd_datas and build_renewable_prof…
daniel-rdt Jul 30, 2025
956939a
feat: add logger warning for missing files
daniel-rdt Jul 30, 2025
090c95e
Merge branch 'master' into feat/47-pecd-complete
daniel-rdt Jul 30, 2025
0b5a298
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 30, 2025
405e4da
feat: introduce safe_pyear helper function
daniel-rdt Jul 30, 2025
96794be
feat: make handling of GB and UK more consistent
daniel-rdt Jul 30, 2025
35e4d45
feat: adjust wording of logger about existing capacities
daniel-rdt Jul 30, 2025
a78fbc5
doc: document compatibility with Solar CSP
daniel-rdt Jul 31, 2025
7bbd23d
doc: document new config option for available pyears in all configs a…
daniel-rdt Jul 31, 2025
2e274a1
doc: add release note
daniel-rdt Jul 31, 2025
27abc95
feat: add verbose option to safe_pyear helper function
daniel-rdt Jul 31, 2025
cf4fc7e
Apply suggestions from code review
daniel-rdt Aug 1, 2025
7e51535
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 1, 2025
67f44ac
fix: remove manual 2050 fallback to 2040 for PECD data
daniel-rdt Aug 1, 2025
7c0a0c0
feat: adjust input and output types in safe_pyear
daniel-rdt Aug 1, 2025
17c880c
Apply suggestions from code review
daniel-rdt Aug 1, 2025
cedc093
feat: refactor input_data_pecd function for easier readability
daniel-rdt Aug 11, 2025
0cb02f8
apply suggestions from code review
daniel-rdt Aug 11, 2025
90616ea
doc: add documentation for retrieve_tyndp_pecd_data rule
daniel-rdt Aug 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/config.tyndp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ electricity:
enable: true
fill_gaps_method: zero
# Complete PECD data is only available for the years 2030, 2040
# TODO: adjust once udpated 2050 PECD data ist available
# TODO: adjust once udpated 2050 PECD data is available
available_years:
- 2030
- 2040
Expand Down
2 changes: 1 addition & 1 deletion config/test/config.tyndp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ electricity:
enable: true
fill_gaps_method: zero
# Complete PECD data is only available for the years 2030, 2040
# TODO: adjust once udpated 2050 PECD data ist available
# TODO: adjust once udpated 2050 PECD data is available
available_years:
- 2030
- 2040
Expand Down
2 changes: 1 addition & 1 deletion doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Release Notes
Upcoming Open-TYNDP Release
================

* Add complete compatibility for processing and preparation of TYNDP 2024 PECD v3.1 renewable profiles (Solar PV rooftop, Solar PV utility, Onshore Wind, Offshore Wind, Solar CSP), replacing default ERA5- and SARAH3-based profiles processed with Atlite (https://github.com/open-energy-transition/open-tyndp/pull/71). This implementation serves to facilitate a sub-workflow for creation of the renewable profiles but does not yet attach them to any technologies yet.
* Add complete compatibility for processing and preparation of PECD v3.1 renewable profiles (Solar PV rooftop, Solar PV utility, Onshore Wind, Offshore Wind, Solar CSP) (https://github.com/open-energy-transition/open-tyndp/pull/71). These profiles are used for the TYNDP 2024 and replace the default ERA5- and SARAH3-based profiles processed with Atlite. This implementation serves to facilitate a sub-workflow for creation of the renewable profiles, but does not yet attach them to any technologies.


Upcoming PyPSA-Eur Release
Expand Down
24 changes: 14 additions & 10 deletions scripts/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,33 +1132,37 @@ def extract_grid_data_tyndp(


def safe_pyear(
year: int,
year: int | str,
available_years: list = [2030, 2040, 2050],
source: str = "TYNDP",
verbose: bool = True,
):
"""
Checks and adjusts whether a given pyear is in the available years and falls back to the previous available year.
Checks and adjusts whether a given pyear is in the available years of a given data source. If not, it falls back to the previous available year.

Parameters
----------
year : int
planning horizon year which will be checked and possibly adjusted to previous available year
planning horizon year which will be checked and possibly adjusted to previous available year.
Comment thread
daniel-rdt marked this conversation as resolved.
Outdated
available_years : list, optional
list of available years. Defaults to [2030, 2040, 2050]
List of available years. Defaults to [2030, 2040, 2050].
source : str, optional
source of the data for which availability will be checked. Defaults to "TYNDP"
Source of the data for which availability will be checked. For logging purpose only. Defaults to "TYNDP".
verbose : bool, optional
Whether to activate verbose logging. Defaults to True
Whether to activate verbose logging. Defaults to True.

Returns
-------
year_new : str
safe pyear as a string
year_new : int
safe pyear adjusted for available years
Comment thread
daniel-rdt marked this conversation as resolved.
Outdated
"""

if not available_years:
raise ValueError("`available_years` cannot be empty.")
raise ValueError(
"No `available_years` provided. Expected a non-empty list of years."
)
if not isinstance(year, int):
year = int(year)
if year not in available_years:
lower = [y for y in available_years if y < year]
year_new = max(lower) if lower else available_years[0]
Expand All @@ -1169,4 +1173,4 @@ def safe_pyear(
else:
year_new = year

return str(year_new)
return year_new
8 changes: 1 addition & 7 deletions scripts/build_renewable_profiles_pecd.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,8 @@
year_i = year
# falling back to latest available pyear if not in list of available years
year = safe_pyear(
int(year), available_years=snakemake.params.available_years, source="PECD"
year, available_years=snakemake.params.available_years, source="PECD"
)
# TODO: remove once PECD data is updated
if year == 2050:
logger.warning(
"PECD input data for 2050 is incomplete. Falling back to 2040 PECD data."
)
year = 2040

profile = (
pd.read_csv(
Expand Down
8 changes: 4 additions & 4 deletions scripts/clean_pecd_data.py
Comment thread
daniel-rdt marked this conversation as resolved.
Comment thread
daniel-rdt marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ def read_pecd_file(
node: str,
dir_pecd: str,
cyear: str,
pyear: str,
pyear: int,
technology: str,
sns: pd.DatetimeIndex,
):
fn = Path(
dir_pecd,
pyear,
str(pyear),
f"PECD_{technology}_{pyear}_{node.replace('GB', 'UK')}_edition 2023.2.csv",
)

Expand All @@ -59,7 +59,7 @@ def read_pecd_file(
return None
Comment thread
daniel-rdt marked this conversation as resolved.

Comment thread
daniel-rdt marked this conversation as resolved.
# Malta CSP data file has an extra header row that must be skipped
if node == "MT00" and technology == "CSP_noStorage" and pyear == "2040":
if node == "MT00" and technology == "CSP_noStorage" and pyear == 2040:
skiprows = 11
else:
skiprows = 10
Expand Down Expand Up @@ -111,7 +111,7 @@ def read_pecd_file(

# Planning year (falls back to latest available pyear if not in list of available years)
pyear = safe_pyear(
int(snakemake.wildcards.planning_horizons),
snakemake.wildcards.planning_horizons,
available_years=snakemake.params.available_years,
source="PECD",
)
Expand Down
5 changes: 2 additions & 3 deletions scripts/clean_tyndp_demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ def load_elec_demand(

# handle intermediate years
# TODO: Possibly improve this with linear interpolation for 2035 and 2045
pyear = int(
safe_pyear(int(pyear), available_years=available_years, source="TYNDP demand")
)
pyear = safe_pyear(pyear, available_years=available_years, source="TYNDP demand")

if scenario == "NT":
if pyear == 2050:
logger.warning(
Expand Down
Loading