pik-copan / pyunicorn

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

BUG: set_non_local() does not work for TsonisClimateNetwork #85

Closed fmaschler closed 5 years ago

fmaschler commented 7 years ago

A climate_network seems to leave the initial value of non_localuntouched regardless of changing it with set_non_local(). Here is an example showing that after toggling the attribute the triggered function is the same:

net = climate.TsonisClimateNetwork(data, threshold=0, winter_only=False, non_local=True) Generating a Tsonis climate network... Calculating correlation matrix at zero lag from anomaly values... Extracting network adjacency matrix removing local connections... Calculating angular great circle distance using Weave... Extracting network adjacency matrix by thresholding... Setting area weights according to type surface...

print(net) Tsonis climate network: ... Local connections filtered out: True Use only data points from winter months: False

net.set_non_local(False) Extracting network adjacency matrix removing local connections... Calculating angular great circle distance using Weave... Extracting network adjacency matrix by thresholding... Setting area weights according to type surface...

print(net) Tsonis climate network: ... Local connections filtered out: True Use only data points from winter months: False

The same behaviour is shown for networks initially set to non_local=False, just the other way around. Using the parameter explicily (net.set_non_local(non_local=True)) does not help.

jkroenke commented 5 years ago

This bug could not be reproduced and was probably solved in the migration process from python 2 to python 3.