pypsa-meets-earth / pypsa-earth-sec

GNU General Public License v3.0
19 stars 16 forks source link

Issue with build_cutout #278

Closed doneachh closed 4 months ago

doneachh commented 5 months ago

Checklist

Describe the Bug

As soon as i am running the model a second (or more) time, there is a error message basically saying "cutout already exists. Delete it or set build_cutout = false". As soon as i set build_cutout = false, i receive an error message basically saying build_cutout has to be true or something like that. --> workaround right now is to comment out "terminate_if_cutout_exists" in the snakefile to run the model and set build_cutout=true.

Error Message

Exception with build_cutout enabled:

Exception in file /mnt/c/Users/aca39878/Documents/Git/Africa/pypsa-earth-sec/pypsa-earth/Snakefile, line 336:
An option `build_cutout` is enabled, while a cutout file 'cutouts/cutout-2013-era5.nc' still exists and risks to be overwritten. If this is an intended behavior, please move or delete this file and re-run the rule. Otherwise, just disable the `build_cutout` rule in the config file.
  File "/mnt/c/Users/aca39878/Documents/Git/Africa/pypsa-earth-sec/pypsa-earth/Snakefile", line 344, in <module>
  File "/mnt/c/Users/aca39878/Documents/Git/Africa/pypsa-earth-sec/pypsa-earth/Snakefile", line 336, in terminate_if_cutout_exists
ERROR:snakemake.logging:Exception in file /mnt/c/Users/aca39878/Documents/Git/Africa/pypsa-earth-sec/pypsa-earth/Snakefile, line 336:
An option `build_cutout` is enabled, while a cutout file 'cutouts/cutout-2013-era5.nc' still exists and risks to be overwritten. If this is an intended behavior, please move or delete this file and re-run the rule. Otherwise, just disable the `build_cutout` rule in the config file.
  File "/mnt/c/Users/aca39878/Documents/Git/Africa/pypsa-earth-sec/pypsa-earth/Snakefile", line 344, in <module>
  File "/mnt/c/Users/aca39878/Documents/Git/Africa/pypsa-earth-sec/pypsa-earth/Snakefile", line 336, in terminate_if_cutout_exists

Exception with build_cutout = false:

MissingRuleException:
No rule to produce cutouts/cutout-2013-era5.nc (if you use input functions make sure that they don't raise unexpected exceptions).
ERROR:snakemake.logging:MissingRuleException:
No rule to produce cutouts/cutout-2013-era5.nc (if you use input functions make sure that they don't raise unexpected exceptions).
doneachh commented 5 months ago

Hi @davide-f ! Here the error messages, we've spoke about in the pypsa-earth sec meeting. :)

davide-f commented 4 months ago

With the fix we discussed during the meeting this issue should be bypassed. You find it in the shared branch

doneachh commented 4 months ago

@davide-f Great! :) Guess we can close this issue then?

davide-f commented 4 months ago

Agree :) closing