Skip to content

Commit 1aa5ed1

Browse files
authored
Merge branch 'PyPSA:master' into master
2 parents 245db2f + 5bdfa0d commit 1aa5ed1

12 files changed

Lines changed: 142 additions & 115 deletions

Snakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ from scripts._helpers import (
1818
get_scenarios,
1919
get_shadow,
2020
path_provider,
21+
script_path_provider,
2122
)
2223
from scripts.lib.validation.config import validate_config
2324

@@ -43,6 +44,7 @@ exclude_from_shared = run["shared_resources"]["exclude"]
4344
logs = path_provider("logs/", RDIR, shared_resources, exclude_from_shared)
4445
benchmarks = path_provider("benchmarks/", RDIR, shared_resources, exclude_from_shared)
4546
resources = path_provider("resources/", RDIR, shared_resources, exclude_from_shared)
47+
scripts = script_path_provider(Path(workflow.snakefile).parent)
4648

4749
RESULTS = "results/" + RDIR
4850

doc/release_notes.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ Release Notes
99
Upcoming Release
1010
================
1111

12+
* Add script path getter helper method to allow for rule inheritance in nested snakefiles.
13+
1214
* Include new storage technologies such as li-ion, vanadium, lfp, lair, pair and iron-air. These technologies can now be configured as either store-link combinations or standalone storage units.
1315
Implemented in both `add_electricity.py` and `prepare_sector_network.py` (https://github.com/PyPSA/pypsa-eur/pull/1961).
1416

1517
* Updated data sources for country-level electricity demand time series. In addition to the OPSD data (``retrieve_electricity_demand_opsd``, demand time series
1618
are now downloaded via the ENTSO-E Transparency Platform API (``retrieve_electricity_demand_entsoe`` environment variable ``ENTSOE_API_KEY`` required)
1719
and from the NESO data portal for Great Britain and Northern Ireland (``retrieve_electricity_demand_neso``).
18-
Manual corrections and gap filling methods have been applied and checked for data until the end of 2025.
20+
Manual corrections and gap filling methods have been applied and checked for data until the end of 2025.
1921
(https://github.com/PyPSA/pypsa-eur/pull/1828).
2022

2123
* Applied scaling of kW and GW to MW for custom_costs as well (https://github.com/PyPSA/pypsa-eur/pull/2023).

rules/build_electricity.smk

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ rule build_electricity_demand:
3030
resources:
3131
mem_mb=5000,
3232
script:
33-
"../scripts/build_electricity_demand.py"
33+
scripts("build_electricity_demand.py")
3434

3535

3636
rule build_powerplants:
@@ -55,7 +55,7 @@ rule build_powerplants:
5555
resources:
5656
mem_mb=7000,
5757
script:
58-
"../scripts/build_powerplants.py"
58+
scripts("build_powerplants.py")
5959

6060

6161
def input_base_network(w):
@@ -107,7 +107,7 @@ rule base_network:
107107
resources:
108108
mem_mb=2000,
109109
script:
110-
"../scripts/base_network.py"
110+
scripts("base_network.py")
111111

112112

113113
rule build_osm_boundaries:
@@ -124,7 +124,7 @@ rule build_osm_boundaries:
124124
resources:
125125
mem_mb=1500,
126126
script:
127-
"../scripts/build_osm_boundaries.py"
127+
scripts("build_osm_boundaries.py")
128128

129129

130130
rule build_bidding_zones:
@@ -149,7 +149,7 @@ rule build_bidding_zones:
149149
resources:
150150
mem_mb=1500,
151151
script:
152-
"../scripts/build_bidding_zones.py"
152+
scripts("build_bidding_zones.py")
153153

154154

155155
rule build_shapes:
@@ -187,7 +187,7 @@ rule build_shapes:
187187
resources:
188188
mem_mb=1500,
189189
script:
190-
"../scripts/build_shapes.py"
190+
scripts("build_shapes.py")
191191

192192

193193
if CUTOUT_DATASET["source"] in ["build"]:
@@ -207,7 +207,7 @@ if CUTOUT_DATASET["source"] in ["build"]:
207207
resources:
208208
mem_mb=config["atlite"].get("nprocesses", 4) * 1000,
209209
script:
210-
"../scripts/build_cutout.py"
210+
scripts("build_cutout.py")
211211

212212

213213
rule build_ship_raster:
@@ -225,7 +225,7 @@ rule build_ship_raster:
225225
benchmark:
226226
benchmarks("build_ship_raster")
227227
script:
228-
"../scripts/build_ship_raster.py"
228+
scripts("build_ship_raster.py")
229229

230230

231231
rule determine_availability_matrix_MD_UA:
@@ -269,7 +269,7 @@ rule determine_availability_matrix_MD_UA:
269269
resources:
270270
mem_mb=config["atlite"].get("nprocesses", 4) * 5000,
271271
script:
272-
"../scripts/determine_availability_matrix_MD_UA.py"
272+
scripts("determine_availability_matrix_MD_UA.py")
273273

274274

275275
# Optional input when having Ukraine (UA) or Moldova (MD) in the countries list
@@ -341,7 +341,7 @@ rule determine_availability_matrix:
341341
resources:
342342
mem_mb=config["atlite"].get("nprocesses", 4) * 5000,
343343
script:
344-
"../scripts/determine_availability_matrix.py"
344+
scripts("determine_availability_matrix.py")
345345

346346

347347
rule build_renewable_profiles:
@@ -377,7 +377,7 @@ rule build_renewable_profiles:
377377
wildcard_constraints:
378378
technology="(?!hydro).*", # Any technology other than hydro
379379
script:
380-
"../scripts/build_renewable_profiles.py"
380+
scripts("build_renewable_profiles.py")
381381

382382

383383
rule build_monthly_prices:
@@ -397,7 +397,7 @@ rule build_monthly_prices:
397397
resources:
398398
mem_mb=5000,
399399
script:
400-
"../scripts/build_monthly_prices.py"
400+
scripts("build_monthly_prices.py")
401401

402402

403403
if COUNTRY_RUNOFF_DATASET["source"] == "build":
@@ -417,7 +417,7 @@ if COUNTRY_RUNOFF_DATASET["source"] == "build":
417417
benchmark:
418418
benchmarks("build_country_runoff")
419419
script:
420-
"../scripts/build_country_runoff.py"
420+
scripts("build_country_runoff.py")
421421

422422

423423
rule build_hydro_profile:
@@ -445,7 +445,7 @@ rule build_hydro_profile:
445445
resources:
446446
mem_mb=5000,
447447
script:
448-
"../scripts/build_hydro_profile.py"
448+
scripts("build_hydro_profile.py")
449449

450450

451451
rule build_line_rating:
@@ -469,7 +469,7 @@ rule build_line_rating:
469469
resources:
470470
mem_mb=config["atlite"].get("nprocesses", 4) * 1000,
471471
script:
472-
"../scripts/build_line_rating.py"
472+
scripts("build_line_rating.py")
473473

474474

475475
rule build_transmission_projects:
@@ -504,7 +504,7 @@ rule build_transmission_projects:
504504
mem_mb=4000,
505505
threads: 1
506506
script:
507-
"../scripts/build_transmission_projects.py"
507+
scripts("build_transmission_projects.py")
508508

509509

510510
rule add_transmission_projects_and_dlr:
@@ -542,7 +542,7 @@ rule add_transmission_projects_and_dlr:
542542
resources:
543543
mem_mb=4000,
544544
script:
545-
"../scripts/add_transmission_projects_and_dlr.py"
545+
scripts("add_transmission_projects_and_dlr.py")
546546

547547

548548
def input_class_regions(w):
@@ -575,7 +575,7 @@ rule build_electricity_demand_base:
575575
resources:
576576
mem_mb=5000,
577577
script:
578-
"../scripts/build_electricity_demand_base.py"
578+
scripts("build_electricity_demand_base.py")
579579

580580

581581
rule build_hac_features:
@@ -598,7 +598,7 @@ rule build_hac_features:
598598
resources:
599599
mem_mb=10000,
600600
script:
601-
"../scripts/build_hac_features.py"
601+
scripts("build_hac_features.py")
602602

603603

604604
rule process_cost_data:
@@ -619,7 +619,7 @@ rule process_cost_data:
619619
resources:
620620
mem_mb=4000,
621621
script:
622-
"../scripts/process_cost_data.py"
622+
scripts("process_cost_data.py")
623623

624624

625625
rule simplify_network:
@@ -654,7 +654,7 @@ rule simplify_network:
654654
resources:
655655
mem_mb=12000,
656656
script:
657-
"../scripts/simplify_network.py"
657+
scripts("simplify_network.py")
658658

659659

660660
# Optional input when using custom busmaps - Needs to be tailored to selected base_network
@@ -734,7 +734,7 @@ rule cluster_network:
734734
resources:
735735
mem_mb=10000,
736736
script:
737-
"../scripts/cluster_network.py"
737+
scripts("cluster_network.py")
738738

739739

740740
def input_profile_tech(w):
@@ -813,7 +813,7 @@ rule add_electricity:
813813
resources:
814814
mem_mb=10000,
815815
script:
816-
"../scripts/add_electricity.py"
816+
scripts("add_electricity.py")
817817

818818

819819
rule prepare_network:
@@ -850,7 +850,7 @@ rule prepare_network:
850850
resources:
851851
mem_mb=4000,
852852
script:
853-
"../scripts/prepare_network.py"
853+
scripts("prepare_network.py")
854854

855855

856856
if (
@@ -898,7 +898,7 @@ if (
898898
resources:
899899
mem_mb=4000,
900900
script:
901-
"../scripts/clean_osm_data.py"
901+
scripts("clean_osm_data.py")
902902

903903
rule build_osm_network:
904904
message:
@@ -935,7 +935,7 @@ if (
935935
resources:
936936
mem_mb=4000,
937937
script:
938-
"../scripts/build_osm_network.py"
938+
scripts("build_osm_network.py")
939939

940940

941941
if config["electricity"]["base_network"] == "tyndp":
@@ -970,4 +970,4 @@ if config["electricity"]["base_network"] == "tyndp":
970970
resources:
971971
mem_mb=4000,
972972
script:
973-
"../scripts/build_tyndp_network.py"
973+
scripts("build_tyndp_network.py")

0 commit comments

Comments
 (0)