Skip to content

Commit 4a0350e

Browse files
lindnemiJulianGeis
andauthored
Switch model to use only public version of database (#81)
* new names for the scenarios * delete public config * not used in pypsa-de * discontinue fallback_reference_scenario * hard-code 2020 values from internal db * remove unused code * simplify readme * whitespace * remove unused code * convert everything to MWh * convert to Mwh instead of Gj * fix pandas warning * rename prefix * fix empty plot * fix overlooked conversion from Joule * fix mobility demand * fix rounding error in exporter * increased tolerance for comparison * switch to Mix value from steel production from Forecast 2020 * more correction of hardcoded steel values * bump version * add changes --------- Co-authored-by: JulianGeis <JulianGeis@gmx.net>
1 parent 30d9b92 commit 4a0350e

32 files changed

+322
-1226
lines changed

.github/workflows/validate.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ jobs:
5454
# <scenario>/<plot_name>.png
5555
plots: >
5656
"
57-
KN2045_Bal_v4/ariadne/primary_energy.png
58-
KN2045_Bal_v4/ariadne/secondary_energy.png
59-
KN2045_Bal_v4/ariadne/final_energy.png
57+
KN2045_Mix/ariadne/primary_energy.png
58+
KN2045_Mix/ariadne/secondary_energy.png
59+
KN2045_Mix/ariadne/final_energy.png
6060
ariadne_comparison/Trade-Secondary-Energy-Hydrogen-Volume.png
6161
ariadne_comparison/Trade-Secondary-Energy-Liquids-Hydrogen-Volume.png
6262
ariadne_comparison/Capacity-Electricity-Solar.png

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Changelog
2+
- 0.3: workflow is all public now, no longer requires credentials to internal data
23
- Allowing myopic optimization until 2050
34
- CHP plants located in onshore regions without district heating are represented as EOP plants
45
- updating technology cost data to v0.11.0

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cff-version: 1.2.0
22
message: "pypsa-de"
33
title: "PyPSA-DE - Hochaufgelöstes, sektorengekoppeltes Modell des deutschen Energiesystems"
44
repository: https://github.com/PyPSA/pypsa-de
5-
version: 0.2.0
5+
version: 0.3.0
66
doi: "10.5281/zenodo.15096969"
77
date-released: "Mar 27, 2025"
88
license: MIT

README.md

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,42 +24,11 @@ Where `{os}` should be replaced with your operating system, e.g. for linux the c
2424
conda env create -f envs/linux-pinned.yaml
2525
```
2626

27-
## Connecting to the Ariadne-Database
28-
29-
### For external users: Use config.public.yaml
30-
31-
The default workflow configured for this repository assumes access to the internal Ariadne2 database. The database will soon be publicly available. Until then, users that do not have the required login details can run the analysis based on the data published during the [first phase of the Ariadne project](https://data.ece.iiasa.ac.at/ariadne/).
32-
33-
This is possible by providing an additional config to the snakemake workflow. For every `snakemake COMMAND` specified in the instructions below, public users should use:
34-
35-
```
36-
snakemake COMMAND --configfile=config/config.public.yaml
37-
```
38-
39-
The additional config file specifies the required database, model, and scenario names for Ariadne1. If public users wish to edit the default scenario specifications, they can do so by changing `scenarios.public.yaml` to `scenarios.manual.yaml`. More details on using scenarios are given below.
40-
41-
### For internal users: Provide login details
42-
43-
The snakemake rule `retrieve_ariadne_database` logs into the interal Ariadne IIASA Database via the [`pyam`](https://pyam-iamc.readthedocs.io/en/stable/tutorials/iiasa.html) package. The credentials for logging into this database have to be stored locally on your machine with `ixmp4`. To do this activate the project environment and run
44-
45-
```
46-
ixmp4 login <username>
47-
```
48-
49-
You will be prompted to enter your `<password>`.
50-
51-
Caveat: These credentials are stored on your machine in plain text.
52-
53-
To switch between internal and public use, the command `ixmp4 logout` may be necessary.
54-
5527
## Run the analysis
5628

5729
Before running any analysis with scenarios, the rule `build_scenarios` must be executed. This will create the file `config/scenarios.automated.yaml` which includes input data and CO2 targets from the IIASA Ariadne database as well as the specifications from the manual scenario file. [This file is specified in the config.de.yaml via they key `run:scenarios:manual_file` and located at `config/scenarios.manual.yaml` by default].
5830

5931
snakemake build_scenarios -f
60-
or in case of using the public database
61-
62-
snakemake build_scenarios --configfile=config/config.public.yaml -f
6332

6433
Note that the hierarchy of scenario files is the following: `scenarios.automated.yaml` > (any `explicitly specified --configfiles`) > `config.de.yaml `> `config.default.yaml `Changes in the file `scenarios.manual.yaml `are only taken into account if the rule `build_scenarios` is executed.
6534

@@ -88,7 +57,6 @@ PyPSA-DE is a softfork of PyPSA-EUR. As such, large parts of the functionality a
8857
- Default resolution of 16 regions in Germany and 13 region for neighboring countries
8958
- 10 pre-defined scenarios (1 Current Policies, 3 Net-Zero Scenarios (Balanced, Focus H2, Focus Electricity), 2 Demand Variations based on the Balanced Scenario, 4 Demand Variations Based on the Current Policies Scenario)
9059
- Specific cost assumption for Germany:
91-
9260
- Gas, Oil, Coal prices
9361
- electrolysis and heat-pump costs
9462
- Infrastructure costs [according to the Netzentwicklungsplan](https://github.com/PyPSA/pypsa-ariadne/pull/193) 2021 and 2023

Snakefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,6 @@ rule modify_existing_heating:
453453
params:
454454
iiasa_reference_scenario=config_provider("iiasa_database", "reference_scenario"),
455455
leitmodelle=config_provider("iiasa_database", "leitmodelle"),
456-
fallback_reference_scenario=config_provider(
457-
"iiasa_database", "fallback_reference_scenario"
458-
),
459456
input:
460457
ariadne=resources("ariadne_database.csv"),
461458
existing_heating="data/existing_infrastructure/existing_heating_raw.csv",
@@ -641,9 +638,7 @@ rule export_ariadne_variables:
641638
rule plot_ariadne_variables:
642639
params:
643640
iiasa_scenario=config_provider("iiasa_database", "reference_scenario"),
644-
fallback_reference_scenario=config_provider(
645-
"iiasa_database", "fallback_reference_scenario"
646-
),
641+
reference_scenario=config_provider("iiasa_database", "reference_scenario"),
647642
input:
648643
exported_variables_full=RESULTS + "ariadne/exported_variables_full.xlsx",
649644
ariadne_database=resources("ariadne_database.csv"),

config/config.de.yaml

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,14 @@
44

55
# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#run
66
run:
7-
prefix: 20250414_merge_master_april
7+
prefix: 20250425_public_db
88
name:
9-
# - CurrentPolicies
10-
- KN2045_Bal_v4
11-
# - KN2045_Elec_v4
12-
# - KN2045_H2_v4
13-
# - KN2045plus_EasyRide
14-
# - KN2045plus_LowDemand
15-
# - KN2045minus_WorstCase
16-
# - KN2045minus_SupplyFocus
17-
# - KN2045_Bal_LowDemand
18-
# - KN2045_Bal_HighDemand
9+
# - ExPol
10+
- KN2045_Mix
11+
# - KN2045_Elek
12+
# - KN2045_H2
13+
# - KN2045_NFniedrig
14+
# - KN2045_NFhoch
1915
scenarios:
2016
enable: true
2117
manual_file: config/scenarios.manual.yaml
@@ -32,22 +28,20 @@ run:
3228
disable_progressbar: true
3329

3430
iiasa_database:
35-
db_name: ariadne2_intern
31+
db_name: ariadne2
3632
leitmodelle:
3733
general: REMIND-EU v1.1
3834
buildings: REMod v1.0
3935
transport: Aladin v1
4036
industry: FORECAST v1.0
4137
scenarios:
42-
- CurrentPolicies
43-
- KN2045_Elec_v4
44-
- KN2045_H2_v4
45-
- KN2045_Bal_v4
46-
- KN2045plus_EasyRide
47-
- KN2045plus_LowDemand
48-
- KN2045minus_WorstCase
49-
- KN2045minus_SupplyFocus
50-
reference_scenario: KN2045_Bal_v4
38+
- ExPol
39+
- KN2045_Elek
40+
- KN2045_H2
41+
- KN2045_Mix
42+
- KN2045_NFniedrig
43+
- KN2045_NFhoch
44+
reference_scenario: KN2045_Mix
5145
region: Deutschland
5246

5347
# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#foresight
@@ -298,7 +292,6 @@ sector:
298292
rural: true
299293
co2_spatial: true
300294
biomass_spatial: true
301-
#TBD what to include in config
302295
#relax so no infeasibility in 2050 with no land transport demand
303296
min_part_load_fischer_tropsch: 0.
304297
regional_methanol_demand: true #set to true if regional CO2 constraints needed

config/config.public.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)