You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to be due to the function aggregatelines called previously that does stuff on the lines dataframe including groupbys.
That should normally drop such columns but that does not happen when the dataframe is empty.
This is an error we experienced when running the pypsa-earth workflow on rwanda.
Error Message
If applicable, paste any terminal output to help illustrating your problem. In some cases it may also be useful to share your list of installed packages: conda list.
Exception has occurred: ValueError (note: full exception trace is shown but execution is paused at: _run_module_as_main)
cannot insert bus1_s, already exists
File "/home/davidef/miniconda3/envs/pypsa-earth/lib/python3.10/site-packages/pandas/core/frame.py", line 4814, in insert
raise ValueError(f"cannot insert {column}, already exists")
File "/home/davidef/miniconda3/envs/pypsa-earth/lib/python3.10/site-packages/pandas/core/frame.py", line 6358, in reset_index
new_obj.insert(
File "/home/davidef/miniconda3/envs/pypsa-earth/lib/python3.10/site-packages/pandas/util/_decorators.py", line 331, in wrapper
return func(*args, **kwargs)
File "/home/davidef/miniconda3/envs/pypsa-earth/lib/python3.10/site-packages/pypsa/networkclustering.py", line 351, in get_buses_linemap_and_lines
lines.reset_index()
File "/home/davidef/miniconda3/envs/pypsa-earth/lib/python3.10/site-packages/pypsa/networkclustering.py", line 378, in get_clustering_from_busmap
buses, linemap, linemap_p, linemap_n, lines, lines_t = get_buses_linemap_and_lines(
File "/data/davidef/git_world/pypsa-earth/scripts/cluster_network.py", line 444, in clustering_for_n_clusters
clustering = get_clustering_from_busmap(
File "/data/davidef/git_world/pypsa-earth/scripts/cluster_network.py", line 577, in <module>
clustering = clustering_for_n_clusters(
File "/home/davidef/miniconda3/envs/pypsa-earth/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/davidef/miniconda3/envs/pypsa-earth/lib/python3.10/runpy.py", line 196, in _run_module_as_main (Current frame)
return _run_code(code, main_globals, None,
The text was updated successfully, but these errors were encountered:
Checklist
master
branch or the latest release. Please indicate:Describe the Bug
This problem arises in the function
get_buses_linemap_and_lines
in the following code when the lines dataframe is empty:This seems to be due to the function aggregatelines called previously that does stuff on the lines dataframe including groupbys.
That should normally drop such columns but that does not happen when the dataframe is empty.
This is an error we experienced when running the pypsa-earth workflow on rwanda.
Error Message
If applicable, paste any terminal output to help illustrating your problem.
In some cases it may also be useful to share your list of installed packages:
conda list
.The text was updated successfully, but these errors were encountered: