-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in cluster_network #974
Comments
Hello @ariannaleoni! Thanks for reporting. You are right that the number of clusters is read from the configuration file and not updated after. That is the expected behaviour, while Could you please share some details to reproduce the error you encounter? Could you please share your |
Hi! Indeed, changing the parameter "cluster" in config.yaml solves the problem. However, there is still an error. Here is the elec_s_10.log file. The config.yaml is identical to the one reported on GitHub, with the only difference being the value of the parameter "cluster," which is now set to 10. INFO:pypsa.io:Imported network elec_s.nc has buses, carriers, generators, lines, loads, storage_units |
Hello! That is a weird issue with the mismatch of |
I've already tried to build a fresh environment, but it didn't work. However, I'm using version 3.14.14 of Ipopt because there's no precompiled version for osx-arm64. I've tried to compile the software from source, but I couldn't manage to make it work. However, the differences between my installed version, 3.14.14, and the required one, < 3.13.3, should be backward compatible, that is why I installed the Ipopt 3.14.14. Everything else is a fresh install newly created. |
Ok, thanks for letting us know! It seems your are facing same issue as was reported in #968. The workaround is to remove a constraint to Have you tried to re-run the workflow with a new environment? |
I have already removed the ipopt constraint and re-run the workflow in a new environment, but it didn't work |
Thank you for trying. Let's try to debug it together. A few troubleshooting questions:
|
As an additional comment, the issue is unfortunately known but it is tricky to reproduce it. It would be a great achievement, if we would be able to find a way to do so. |
Hello! I've removed the outputs of the previous run before re-running, using the command line snakemake -j 1 clean, and the error is always the same. Anyway, regarding the different sorting of the bus_id, if they are compared as lists (thus with a specific ordering), they are different, but if they are compared as sets (thus the order is no longer relevant), then they are equal. The installed packages in my environment are in this file (they are too many to send as a message) |
Hello @ariannaleoni! Thank you for sharing the environment specification. Could it be that something went wrong during creation of the environment? For example, pypsa-earth/envs/environment.yaml Line 15 in 413e3fe
The CI doesn't show any environment problems. I have also generated a fresh environment locally removing a limitation to If tutorial doesn't work for you, it could make sense to remove the model completely and go through the installation and tutorial following the docs. |
Hi! Apologies for the delayed response, but I've managed to address the issue. Now, I'm attempting to run a new simulation, but I'm encountering some difficulties. I've set the input countries to "africa", but I'm encountering this error: After reviewing the log file, I noticed the following message: "WARNING:main:Weather data does not fully cover the requested region." Additionally, I manually downloaded the cutout files "africa-2013-era5" and "cutout-2013-era5", but encountered the same issue. Do you have any suggestions on how to proceed? |
Hello @ariannaleoni! Great, glad to know that the issue has been resolved. As we discussed, the newly appeared problem has been caused by the fact that the tutorial datasets are created for a particular region only (Nigeria and Benin) and a short timeframe. Since you want to build a full-scale model, the way to go is using parameters of Regarding the mismatch you observe, I do agree that it should not be the case. You can look into the details of the cutout you downloaded using jupyther notebooks provided into |
Hello Katia, I had to do it because frequently the old function failed to create the polygons, leading to the code breaking. By doing this, I ensure that the function retries until it succeeds. Thank you for the help |
Hello @ariannaleoni! Unfortunately, I'm not quite able to trace the whole chain of possible effects. They may actually be also a result also of some combination of factors. I think, the most effective way to deal with that is to take a step back, return to the original state of the codebase and try to reproduce the error which you experienced in As a comment, if you want to contribute by improving the existing code, that is absolutely welcome! Feel free to look into a list of existing issue and join the developers meetings. |
Hello @ekatef ! Error in rule build_shapes: ERROR:snakemake.logging:Error in rule build_shapes: RuleException: And in the log file: ERROR:_helpers:An error happened in module '/Users/ariannaleoni/miniconda3/envs/pypsa-earth/lib/python3.10/site-packages/shapely/constructive.py', function 'simplify': IllegalArgumentException: CGAlgorithmsDD::orientationIndex encountered NaN/Inf numbers Thank you, Arianna |
Hey @ariannaleoni! Thanks a lot for sharing the details. It looks like for some reason the workflow is not happy with geometry it obtains. Not sure what exactly is the reason, but if the issue is reproducible, it would be amazing to have a fix for it. Could you please check that the issue can be reproduced and open a bug report for that? |
Hi @ekatef |
Checklist
main
branch or the latest release.pypsa-earth
environment. Update viaconda env update -f envs/environment.yaml
.Describe the Bug
I encountered a problem when I tried to run the tutorial model of PyPSA-Earth.
I tried to debug and it seems that the problem arise on the assert in the cluster_network script: n_clusters >= len(N) and n_clusters <= N.sum() at line 315.
n_cluster is equal to 2, while len(N) is equal to 10, so the error occurs.
n_cluster is equal to 2 because the number of countries in the model tutorial is two and no bus has a subnetwork assigned, all subnetwork values are empty strings. It seems that the subnetworks are created using " n.determine_network_topology()" at line 480 in cluster_network script, after the initialization of n_cluster with value 2 at line 702 (when cluster == "min"), and no update of the n_cluster is performed.
The error that occurred is as follows:
Error Message
elec_s_6.log:
The text was updated successfully, but these errors were encountered: