Skip to content

Commit

Permalink
Merge pull request #818 from PyPSA/wdpa-no-bYYYY
Browse files Browse the repository at this point in the history
WDPA time-invariant resource files
  • Loading branch information
fneum authored Dec 29, 2023
2 parents 396fdee + accffe7 commit 6ee82e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions rules/build_electricity.smk
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ rule determine_availability_matrix_MD_UA:
input:
copernicus=RESOURCES
+ "Copernicus_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif",
wdpa=RESOURCES + f"WDPA_{bYYYY}.gpkg",
wdpa_marine=RESOURCES + f"WDPA_WDOECM_{bYYYY}_marine.gpkg",
wdpa=RESOURCES + f"WDPA.gpkg",
wdpa_marine=RESOURCES + f"WDPA_WDOECM_marine.gpkg",
gebco=lambda w: (
"data/bundle/GEBCO_2014_2D.nc"
if "max_depth" in config["renewable"][w.technology].keys()
Expand Down
14 changes: 7 additions & 7 deletions rules/retrieve.smk
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ if config["enable"]["retrieve"]:

# Basic pattern where WDPA files can be found
url_pattern = (
"https://d1gam3xoknrgr2.cloudfront.net/current/WDPA_{bYYYY}_Public.zip"
"https://d1gam3xoknrgr2.cloudfront.net/current/WDPA_{bYYYY}_Public_shp.zip"
)

# 3-letter month + 4 digit year for current/previous/next month to test
Expand Down Expand Up @@ -286,10 +286,10 @@ if config["enable"]["retrieve"]:
keep_local=True,
),
params:
zip=RESOURCES + f"WDPA_{bYYYY}_shp.zip",
folder=directory(RESOURCES + f"WDPA_{bYYYY}"),
zip=RESOURCES + f"WDPA_shp.zip",
folder=directory(RESOURCES + f"WDPA"),
output:
gpkg=RESOURCES + f"WDPA_{bYYYY}.gpkg",
gpkg=RESOURCES + f"WDPA.gpkg",
run:
shell("cp {input} {params.zip}")
shell("unzip -o {params.zip} -d {params.folder}")
Expand All @@ -312,10 +312,10 @@ if config["enable"]["retrieve"]:
keep_local=True,
),
params:
zip=RESOURCES + f"WDPA_WDOECM_{bYYYY}_marine.zip",
folder=directory(RESOURCES + f"WDPA_WDOECM_{bYYYY}_marine"),
zip=RESOURCES + f"WDPA_WDOECM_marine.zip",
folder=directory(RESOURCES + f"WDPA_WDOECM_marine"),
output:
gpkg=RESOURCES + f"WDPA_WDOECM_{bYYYY}_marine.gpkg",
gpkg=RESOURCES + f"WDPA_WDOECM_marine.gpkg",
run:
shell("cp {input} {params.zip}")
shell("unzip -o {params.zip} -d {params.folder}")
Expand Down

0 comments on commit 6ee82e0

Please sign in to comment.