pik-copan / pyunicorn

Unified Complex Network and Recurrence Analysis Toolbox
http://pik-potsdam.de/~donges/pyunicorn/
Other
195 stars 86 forks source link

Traceback error in core.interacting_networks when calling functions of climate.coupled_climate_network #157

Closed rimajj closed 2 years ago

rimajj commented 2 years ago

The following functions produce traceback error when called after constructing climate network with climate.coupled_tsonis.CoupledTsonisClimateNetwork(). net.cross_local_clustering() cross_global_clustering() cross_average_path_length() net.cross_closeness()

For example, when calling cross_global_clustering(): Traceback (most recent call last): File "/home/.../testing_pyunicorn.py", line 171, in clustering = net.cross_global_clustering() File "/home/.../python39/lib/python3.9/site-packages/pyunicorn/climate/coupled_climate_network.py", line 402, in cross_global_clustering cc_12 = InteractingNetworks.cross_global_clustering( File "/home/.../python39/lib/python3.9/site-packages/pyunicorn/core/interacting_networks.py", line 761, in cross_global_clustering cc = self.cross_local_clustering(node_list1, node_list2) TypeError: cross_local_clustering() takes 1 positional argument but 3 were given

Other functions, e.g. cross_degree() work fine with the same network.

I tested with different .nc data as input.

I attach my code as .txt file. testing_pyunicorn.txt

lenas95 commented 2 years ago

Hi rimajj, thanks for reporting and supplying the test function. I fixed the issue in pyunicorn/core/interacting_networks.py The test function works now and prints out results. Let me know if the new code works for you.

rimajj commented 2 years ago

Hi lenas95, I tested the new code with several data sets. No errors occurred. Thank you for fixing the problem!