Closed fhg-isi closed 2 months ago
I had the same problem. I am creating a network for a German network. When I set clusters to all or 337 (max) I get the following error
INFO:pypsa.io:Imported network elec_s.nc has buses, carriers, generators, lines, links, loads, shapes, storage_units
ERROR:root:Uncaught exception
Traceback (most recent call last):
File "C:\Workspace\EnergyModels\PyPSA\pypsa-eur\.snakemake\scripts\tmpl0wy95f3.cluster_network.py", line 516, in <module>
clustering = pypsa.clustering.spatial.Clustering(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Clustering.__init__() takes 4 positional arguments but 6 were given
RuleException:
CalledProcessError in file C:\Workspace\EnergyModels\PyPSA\pypsa-eur\rules/build_electricity.smk, line 541:
Command 'C:/Users/ii6823/AppData/Local/miniconda3/envs/pypsa-eur/python.exe "C:\Workspace\EnergyModels\PyPSA\pypsa-eur\.snakemake\scripts\tmpl0wy95f3.cluster_network.py"' returned non-zero exit status 1.
But when I use 336, I can get the result normally
In cluster_network.py
, change to:
clustering = pypsa.clustering.spatial.Clustering(
n, busmap, linemap
)
closed via 73d135360
a) I tried to use the sector tutorial with a larger number of
clusters
and changed the value from 5 to 'all'. Then I get the error below. Maybe you want to use tools like pylint etc. to check for number of arguments.INFO:pypsa.io:Imported network elec_s.nc has buses, carriers, generators, lines, loads, shapes ERROR:root:Uncaught exception Traceback (most recent call last): File "/home/projekt-resilient03/pypsa-eur/.snakemake/scripts/tmpnlfyn0go.cluster_network.py", line 528, in
clustering = pypsa.clustering.spatial.Clustering(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Clustering.init() takes 4 positional arguments but 6 were given
RuleException:
CalledProcessError in file /home/projekt-resilient03/pypsa-eur/rules/build_electricity.smk, line 511:
Command 'set -euo pipefail; /home/projekt-resilient03/conda/envs/pypsa-eur/bin/python3.11 /home/projekt-resilient03/pypsa-eur/.snakemake/scripts/tmpnlfyn0go.cluster_network.py' returned non-zero exit status 1.
[Fri Jul 12 10:11:45 2024]
b) After removing some of the arguments I got another error:
INFO:main:Using biomass potentials for 2030. Traceback (most recent call last): File "/home/projekt-resilient03/pypsa-eur/.snakemake/scripts/tmp9so9_wsv.build_shipping_demand.py", line 60, in
nodal_demand = demand.loc[countries].fillna(0.0)