Skip to content

Commit

Permalink
Merge pull request #423 from calliope-project/overwrite-on-unzip
Browse files Browse the repository at this point in the history
  • Loading branch information
brynpickering authored Aug 7, 2024
2 parents df84b3c + 2b6c7da commit e9cb908
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
* **UPDATE** dropped support for Intel macOS. The workflow may still run on Intel macOS, but we do not actively maintain support (#369).
* **UPDATE** link to GADM data following changes upstream (#376).
* **UPDATE** link to NUTS data to allow for different NUTS years (#380, #382).
* **UPDATE** rules using `unzip` command to only extract relevant data (#327).

### Fixed (models)

Expand Down
11 changes: 1 addition & 10 deletions rules/hydro.smk
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,6 @@ rule download_stations_database:
"curl -sSLo {output} '{params.url}'"


rule basins_database:
message: "Unzip basins database."
input: rules.download_basins_database.output
output: "build/data/basins/hybas_eu_lev07_v1c.shp"
conda: "../envs/shell.yaml"
localrule: True
shell: "unzip {input} -d ./build/data/basins/"


rule stations_database:
message: "Unzip stations database."
input: rules.download_stations_database.output
Expand All @@ -86,7 +77,7 @@ rule stations_database:
rule preprocess_basins:
message: "Preprocess basins."
input:
basins = rules.basins_database.output[0]
basins = rules.download_basins_database.output[0]
params:
x_min = config["scope"]["spatial"]["bounds"]["x_min"],
x_max = config["scope"]["spatial"]["bounds"]["x_max"],
Expand Down
2 changes: 1 addition & 1 deletion rules/nuclear.smk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rule jrc_power_plant_database:
output:
"data/automatic/JRC_OPEN_UNITS.csv"
conda: "../envs/shell.yaml"
shell: "unzip -o {input[0]} JRC_OPEN_UNITS.csv -d data/automatic/"
shell: "unzip {input[0]} JRC_OPEN_UNITS.csv -d data/automatic/"


rule nuclear_regional_capacity:
Expand Down
2 changes: 1 addition & 1 deletion rules/shapes.smk
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ rule raw_gadm_administrative_borders:
output: temp("build/data/raw-gadm/gadm36_{country_code}.gpkg")
conda: "../envs/shell.yaml"
localrule: True
shell: "unzip -o {input} -d build/data/raw-gadm"
shell: "unzip {input} 'gadm36_{wildcards.country_code}.gpkg' -d build/data/raw-gadm"


rule administrative_borders_gadm:
Expand Down
2 changes: 1 addition & 1 deletion rules/transmission.smk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rule entsoe_tyndp_xlsx:
output: "build/data/national/TYNDP-2020-Scenario-Datafile.xlsx",
conda: "../envs/shell.yaml"
localrule: True
shell: "unzip -o {input} 'TYNDP-2020-Scenario-Datafile.xlsx' -d build/data/national"
shell: "unzip {input} 'TYNDP-2020-Scenario-Datafile.xlsx' -d build/data/national"


rule transmission_entsoe_tyndp_tech_module:
Expand Down
2 changes: 1 addition & 1 deletion rules/wind-and-solar.smk
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ rule potentials:
population = "build/data/{resolution}/population.csv",
land_cover = "build/data/{resolution}/land-cover.csv"
conda: "../envs/shell.yaml"
shell: "unzip -o {input} -d build/data"
shell: "unzip {input} '{wildcards.resolution}/*' -d build/data"


rule download_capacity_factors_wind_and_solar:
Expand Down

0 comments on commit e9cb908

Please sign in to comment.