Skip to content

Comments

Switch model to use only public version of database#81

Merged
lindnemi merged 23 commits intomainfrom
public_db
May 6, 2025
Merged

Switch model to use only public version of database#81
lindnemi merged 23 commits intomainfrom
public_db

Conversation

@lindnemi
Copy link
Collaborator

@lindnemi lindnemi commented Apr 24, 2025

This will abolish the distinction between public and private workflows. Some caveats:

The 2020 input values of the models are not published in the DB, therefore they are hard-coded into the respective scripts

All units in the exporter and the plots are changed from GJ/PJ to MWh/TWh

Before asking for a review for this PR make sure to complete the following checklist:

  • Workflow with target rule ariadne_all completes without errors
  • The logic of export_ariadne_variables has been adapted to the changes
  • One or several figures that validate the changes in the PR have been posted as a comment
  • A brief description of the changes has been added to Changelog.md
  • The latest main has been merged into the PR
  • The config has a new prefix of the format YYYYMMDDdescriptive_title

@lindnemi lindnemi marked this pull request as ready for review April 24, 2025 15:18
@lindnemi lindnemi requested a review from Copilot April 24, 2025 15:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR switches the model from using the internal “KN2045_Bal_v4” settings to the public “KN2045_Mix” configuration. Key changes include updating the run parameter across multiple scripts, renaming scenarios and references in configuration files, and adjusting logging formats for improved readability.

Reviewed Changes

Copilot reviewed 25 out of 29 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/pypsa-de/modify_existing_heating.py Updated run parameter and reformatted log message
scripts/pypsa-de/modify_district_heat_share.py Changed run parameter from “KN2045_Bal_v4” to “KN2045_Mix”
scripts/pypsa-de/modify_cost_data.py Updated run parameter
scripts/pypsa-de/cluster_wasserstoff_kernnetz.py Updated run parameter
scripts/pypsa-de/build_scenarios.py Modified aviation demand logic and adjusted steel share updates
scripts/pypsa-de/build_mobility_demand.py Added year parameter in transport data retrieval
... Other scripts and configuration files updated consistently
Files not reviewed (4)
  • Snakefile: Language not supported
  • config/config.public.yaml: Language not supported
  • config/scenarios.public.yaml: Language not supported
  • config/scenarios.template.yaml: Language not supported
Comments suppressed due to low confidence (2)

config/config.de.yaml:31

  • Changing the database name from 'ariadne2_intern' to 'ariadne2' should be coordinated with the actual public database configuration. Ensure that connection credentials and access rights are updated accordingly.
db_name: ariadne2

scripts/pypsa-de/build_scenarios.py:18

  • Removing the try/except block and retrieving aviation demand in TWh/yr assumes that the key always exists in the dataframe. Please verify that all databases used in production provide this key to avoid potential key errors.
aviation = df.loc["Final Energy|Bunkers|Aviation", "TWh/yr"]

@JulianGeis
Copy link
Contributor

JulianGeis commented Apr 28, 2025

What I tested:

  • workflow runs without errors
  • resulting plots from "plot_ariadne_variables" look reasonable
  • The changes in the code make sense to me.

I further investigates two 2020 postnetworks to check if the e.g. loads differ from now and the merge_master_april branch. From my understanding, the numbers should not differ too much. However there are some differences:

loads_new = n_new_2020.loads[n_new_2020.loads.index.str.contains("DE")]
loads_old = n_old_2020.loads[n_old_2020.loads.index.str.contains("DE")]
pd.concat([loads_new.groupby("carrier").sum().p_set , loads_old.groupby("carrier").sum().p_set], axis=1)

If this is not intended this might be something to look into.

@lindnemi
Copy link
Collaborator Author

lindnemi commented May 6, 2025

@JulianGeis I was not able to reproduce the large discrepancies you were seeing when comparing master to this PR. However, I found a unintended change in the steel consumption that had lead to small ~1% changes in e.g. coal demand. It's fixed now and i get:

image

@lindnemi lindnemi merged commit 4a0350e into main May 6, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants