Skip to content

Conversation

@tgilon
Copy link
Member

@tgilon tgilon commented Feb 17, 2025

Closes #6.

Changes proposed in this Pull Request

This PR suggests to add options in PyPSA-Eur to use the custom electricity demand profiles of TYNDP.

The feature can be tested with:

make tyndp

Tasks

Workflow

  1. retrieve_tyndp_bundle
    • Update outputs to add electricity demand data
  2. (new) clean_tyndp_data
    • Prepare the demand data input for build_electricity_demand (electricity) and prepare_sector_network (other carriers - will be covered later)
  3. build_electricity_demand and (new) build_electricity_demand_tyndp
    • By default, data/electricity_demand_raw.csv (OPSD data) and data/load_synthetic_raw.csv (demand calculator) are used.
    • electricity_demand.csv from PyPSA-Eur is a CSV file with hourly resolution data as rows and countries as columns. TYNDP electricity demand profiles have climate years as columns and tabs for each node. Electricity demand data varies across planning years (hence the need for the planning_horizons wildcard for TYNDP demand-related rules).
    • Use of manual adjustments is disabled (as we don't want to alter TYNDP data).
    • Data is given per bidding zones. We want to keep this granularity and will modify the subsequent build_electricity_demand_base rule to work with it.
  4. build_electricity_demand_base and (new) build_electricity_demand_base_tyndp
    • Can be skipped for TYNDP data, no upsampling needed
    • Introduction of planning_horizons wildcard in the TYNDP case
  5. cluster_network
    • Disable cluster option in TYNDP case
    • Make resources/electricity_demand_base_s.nc an optional input as electrical load is used for clustering
  6. add_electricity
    • Optional load attached to the network if OPSD load is used
    • If TYNDP load data is used, no load is attached as it relies on planning_horizons wildcard. Attached in prepare_sector_network.
  7. prepare_sector_network
    • Electricity
      • Electrical load attached to the network in the TYNDP case (for a given planning_horizons).
      • Distribution losses are disabled. TYNDP electricity demand includes T&D losses (Methodology report, p.21). Therefore, there is no additional modelling of the losses.
    • Transport:
    • Heating:
    • Biomass:
      • Biomass boilers are disabled in the config when using TYNDP load (see Heating sector).
    • Industry:
      • Shipping and aviation are included over here (e-kerosene, e-diesel)
      • Synthetic fuels modelling is covered in Separation of synthetic fuel carriers and integration of their demand #4
      • Low temperatrue industrial heat demand is disabled with the Heating sector switch in TYNDP case as heat is not explicitly modelled. A new dependency is added that ensures low temperature heat industrial heat is only enabled when heating sector is enabled.
      • A new configuration switch use_industry_load is introduced for modelling Industrial electricity demand explicitly. This is disabled for TYNDP load.
  8. add_existing_baseyear

Checklist

  • I tested my contribution locally and it works as intended.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to envs/environment.yaml.
  • Changes in configuration options are added in config/config.default.yaml.
  • Changes in configuration options are documented in doc/configtables/*.csv.
  • Changes in configuration options are added in config/test/*.yaml.
  • Sources of newly added data are documented in doc/data_sources.rst.
  • A release note doc/release_notes.rst is added.

tgilon and others added 23 commits November 12, 2024 16:01
)

Bumps the github-actions group with 1 update: [lkstrp/pypsa-validator](https://github.com/lkstrp/pypsa-validator).


Updates `lkstrp/pypsa-validator` from 0.2.3 to 0.2.4
- [Release notes](https://github.com/lkstrp/pypsa-validator/releases)
- [Commits](PyPSA/pypsa-validator@v0.2.3...v0.2.4)

---
updated-dependencies:
- dependency-name: lkstrp/pypsa-validator
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* add retrieve rule and script to retrieve TYNDP data bundle from Zenodo

* Improve doc string

* Add data retrieve as default for tyndp

* Shorten folder name

---------

Co-authored-by: daniel-rdt <[email protected]>
)

* add initial structure and script for tyndp data cleaning

* add loading and prep of electricity demand

* Fix naming convention and formatting

* Use snapshot year as electricity demand and climatic year are correlated

* Add a fallback option if snapshot year is not available in TYNDP data

* Write output file in resources and match naming convention

* Add parameters for the scenarios

* Add more documentation

* Shorten naming convention

* Address data inconsistencies in electricity profiles

---------

Co-authored-by: daniel-rdt <[email protected]>
@daniel-rdt daniel-rdt mentioned this pull request Feb 17, 2025
7 tasks
@daniel-rdt daniel-rdt mentioned this pull request Apr 23, 2025
7 tasks
@tgilon tgilon changed the title Update electricity demand profiles feat: update electricity demand profiles Apr 25, 2025
@tgilon tgilon requested review from coroa and daniel-rdt May 14, 2025 08:24
Copy link
Member

@daniel-rdt daniel-rdt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tgilon! Good catch with the UK / GB load! I also validated the load again on a yearly total load per country basis and it passes the assertion locally. Should we maybe introduce an assertion unit test for this into the workflow based on your validation notebook?

Copy link
Member

@coroa coroa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general, a few small improvements and questions, i do still have :)

@coroa
Copy link
Member

coroa commented May 14, 2025

Re: Heating demand. It would be better if we can deactivate the heating demand with some heating specific settings (since this can then also avoid calculating all the heat pump profiles and temperature dependent heat demand inputs).

@coroa
Copy link
Member

coroa commented May 14, 2025

Maybe we need to add a sort of validate config step during which incompatible settings are raising. Out of scope for this PR.

@tgilon
Copy link
Member Author

tgilon commented May 14, 2025

Should we maybe introduce an assertion unit test for this into the workflow based on your validation notebook?

I thought about it. Since we need the output of prepare_sector_network, I haven't been able to identify a useful test.

@coroa
Copy link
Member

coroa commented May 14, 2025

So, nothing here is blocking anymore in my opinion.

I would like that the load_source != "tyndp" fences vanish in favour of existing or new heat sector config settings, which at the moment should be only documented to be co-dependent. It's fine with me if you want to address this in a follow up PR.

And before the final tyndp release we are aiming for some sort of config validation, which complains if incompatible settings are chosen.

@tgilon
Copy link
Member Author

tgilon commented May 14, 2025

After discussing with @coroa and @daniel-rdt, I will use the sector:heating rather than the specific load_source parameter. This avoids using electricity related configurations in prepare_sector_network. However, as this introduces configuration dependencies, an issue has been opened #43 to document dependencies.

@tgilon
Copy link
Member Author

tgilon commented May 14, 2025

@coroa @daniel-rdt Here is a summary of what I did:

  • biomass_boilers and oil_boilers are existing config. I've disabled them.
  • I've removed the warning for the electricity distribution grid as this will be addressed by the config validation.
  • I introduced a new config for the industrial load: sector:use_industry_load. This is similar to the heating question.

All of this is documented in #43.

@tgilon
Copy link
Member Author

tgilon commented May 15, 2025

All the requests and comments have been addressed.

I have also re-validated the results. The PR is available here: #44 and an updated notebook can be found here.

@tgilon tgilon merged commit 17d1568 into master May 16, 2025
8 of 9 checks passed
@tgilon tgilon deleted the feature/9-update-electricity-demand-profiles branch May 16, 2025 09:26
@tgilon tgilon added the major feature Major feature for the Open TYNDP. label Jul 22, 2025
@tgilon tgilon mentioned this pull request Nov 3, 2025
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

major feature Major feature for the Open TYNDP.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update electricity demand profiles

6 participants