Fix needed to replace snakemake.config
with snakemake.params
#879
Labels
bug
Something isn't working
snakemake.config
with snakemake.params
#879
Discussed in #878
Originally posted by Haiping007 September 30, 2023
Hi, I tried to run pypsa-earth for Kenya many times, and it keep failed in the step of simplify_network, showing "NameError: name 'config' is not defined" and "errors in rule simply_network" . I run the the same approach for Madagascar which is fine. I am wondering: are there any issues for the data of Kenya? Does anyone has the experience or suggestion on how to solve it?
The information about the errors in the terminal is as the follows:
......
INFO:snakemake.logging:
C:\Users\haipings\AppData\Local\miniconda3\envs\pypsa-earth\lib\site-packages\pypsa\networkclustering.py:16: UserWarning: The namespace
pypsa.networkclustering
is deprecated and will be removed in PyPSA v0.24. Please usepypsa.clustering.spatial instead
.warnings.warn(
This is the repository path: C:\Users\haipings\pypsa\pypsa-earth_KE_new\pypsa-earth
Had to go 0 folder(s) up.
C:\Users\haipings\AppData\Local\miniconda3\envs\pypsa-earth\lib\site-packages\pypsa\components.py:318: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
attrs.loc[bool_b, "default"] = attrs.loc[bool_b].isin({True, "True"})
C:\Users\haipings\AppData\Local\miniconda3\envs\pypsa-earth\lib\site-packages\pypsa\components.py:318: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
attrs.loc[bool_b, "default"] = attrs.loc[bool_b].isin({True, "True"})
C:\Users\haipings\AppData\Local\miniconda3\envs\pypsa-earth\lib\site-packages\pypsa\components.py:318: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
attrs.loc[bool_b, "default"] = attrs.loc[bool_b].isin({True, "True"})
C:\Users\haipings\AppData\Local\miniconda3\envs\pypsa-earth\lib\site-packages\pypsa\components.py:318: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
attrs.loc[bool_b, "default"] = attrs.loc[bool_b].isin({True, "True"})
INFO:pypsa.io:Imported network elec.nc has buses, carriers, generators, lines, links, loads, storage_units, transformers
INFO:main:Mapping all network lines onto a single 380kV layer
INFO:main:Simplifying connected link components
Traceback (most recent call last):
File "C:\Users\haipings\pypsa\pypsa-earth_KE_new\pypsa-earth.snakemake\scripts\tmp_3tz6bla.simplify_network.py", line 857, in
n, simplify_links_map = simplify_links(
File "C:\Users\haipings\pypsa\pypsa-earth_KE_new\pypsa-earth.snakemake\scripts\tmp_3tz6bla.simplify_network.py", line 384, in simplify_links
connection_costs_per_link = _prepare_connection_costs_per_link(
File "C:\Users\haipings\pypsa\pypsa-earth_KE_new\pypsa-earth.snakemake\scripts\tmp_3tz6bla.simplify_network.py", line 169, in _prepare_connection_costs_per_link
if config["electricity"]["hvdc_as_lines"]:
NameError: name 'config' is not defined
[Fri Sep 29 21:11:54 2023]
INFO:snakemake.logging:[Fri Sep 29 21:11:54 2023]
Error in rule simplify_network:
jobid: 5
input: networks/elec.nc, resources/costs.csv, resources/bus_regions/regions_onshore.geojson, resources/bus_regions/regions_offshore.geojson
output: networks/elec_s.nc, resources/bus_regions/regions_onshore_elec_s.geojson, resources/bus_regions/regions_offshore_elec_s.geojson, resources/bus_regions/busmap_elec_s.csv, resources/bus_regions/connection_costs_s.csv
log: logs/simplify_network/elec_s.log (check log file(s) for error details)
ERROR:snakemake.logging:Error in rule simplify_network:
jobid: 5
input: networks/elec.nc, resources/costs.csv, resources/bus_regions/regions_onshore.geojson, resources/bus_regions/regions_offshore.geojson
output: networks/elec_s.nc, resources/bus_regions/regions_onshore_elec_s.geojson, resources/bus_regions/regions_offshore_elec_s.geojson, resources/bus_regions/busmap_elec_s.csv, resources/bus_regions/connection_costs_s.csv
log: logs/simplify_network/elec_s.log (check log file(s) for error details)
RuleException:
CalledProcessError in file C:\Users\haipings\pypsa\pypsa-earth_KE_new\pypsa-earth\Snakefile, line 590:
Command 'C:/Users/haipings/AppData/Local/miniconda3/envs/pypsa-earth/python.exe "C:\Users\haipings\pypsa\pypsa-earth_KE_new\pypsa-earth.snakemake\scripts\tmp_3tz6bla.simplify_network.py"' returned non-zero exit status 1.
File "C:\Users\haipings\pypsa\pypsa-earth_KE_new\pypsa-earth\Snakefile", line 590, in __rule_simplify_network
File "C:\Users\haipings\AppData\Local\miniconda3\envs\pypsa-earth\lib\concurrent\futures\thread.py", line 58, in run
ERROR:snakemake.logging:RuleException:
CalledProcessError in file C:\Users\haipings\pypsa\pypsa-earth_KE_new\pypsa-earth\Snakefile, line 590:
Command 'C:/Users/haipings/AppData/Local/miniconda3/envs/pypsa-earth/python.exe "C:\Users\haipings\pypsa\pypsa-earth_KE_new\pypsa-earth.snakemake\scripts\tmp_3tz6bla.simplify_network.py"' returned non-zero exit status 1.
File "C:\Users\haipings\pypsa\pypsa-earth_KE_new\pypsa-earth\Snakefile", line 590, in __rule_simplify_network
File "C:\Users\haipings\AppData\Local\miniconda3\envs\pypsa-earth\lib\concurrent\futures\thread.py", line 58, in run
Shutting down, this might take some time.
WARNING:snakemake.logging:Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
ERROR:snakemake.logging:Exiting because a job execution failed. Look above for error message
Complete log: .snakemake\log\2023-09-29T193401.403530.snakemake.log
WARNING:snakemake.logging:Complete log: .snakemake\log\2023-09-29T193401.403530.snakemake.log
The text was updated successfully, but these errors were encountered: