pypsa-meets-earth / pypsa-earth

PyPSA-Earth: A flexible Python-based open optimisation model to study energy system futures around the world.
https://pypsa-earth.readthedocs.io/en/latest/
213 stars 169 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'temp/shapefiles' #150

Closed pz-max closed 2 years ago

pz-max commented 2 years ago

Running into a little issue when alternative_clustering: True: https://github.com/pypsa-meets-africa/pypsa-africa/blob/93b72de9f062aa57cd0dc362d3665b5be4eb9e94/scripts/cluster_network.py#L252-L290

Did you manually create this tmp folder or how this error did not appear in your case @Hazem-IEG?

pz-max commented 2 years ago

There is always some debugging necessary after merging PR's (which is fun for me, but not so much fun for new starters). We need some automatic workflow to test prior merging a PR:

Does the whole workflow works for:

davide-f commented 2 years ago

I definitely agree on CI, what is critical is that we need also to modify the input raw data for a simple and small subset so that it is possible to run the CI without using retrieve_databundle_light. In my opinion, we need to draw a simple case test to be kept in github so that when CI is launched, it simply clones the github and that's all. We cannot rely on googledrive nor large files to be downloaded, otherwise it breaks or it becomes long to perform the CI. I add these tasks to the TODO list

pz-max commented 2 years ago

Agree. PyPSA-Eur could provide a good place for best-practice

davide-f commented 2 years ago

Regarding the specific issue, do we really need those two for loops? It seems to me that they are loading the gadm shapes, according to the optional layer id. This can be automatically done by using get_GADM_layer:

https://github.com/pypsa-meets-africa/pypsa-africa/blob/93b72de9f062aa57cd0dc362d3665b5be4eb9e94/scripts/build_shapes.py#L105-157

hazemakhalek commented 2 years ago

Tmp file was just for personal testing and I forgot to delete it. I will take care of that if it's still there.

@davide-f agreed, the loops are not necessary, I overlooked the function

hazemakhalek commented 2 years ago

@pz-max should be fixed now, give me a quick call if it's not. @davide-f utilized the function from build_shapes.py, thanks for the good catch ;)

pz-max commented 2 years ago

Thanks Hazem. Works smoothly now! :)