Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: PartialCorrelationClimateNetwork._calculate_correlation() throws dubious divide-by-zero warning on Windows builds only #235

Open
fkuehlein opened this issue Jul 15, 2024 · 0 comments
Labels

Comments

@fkuehlein
Copy link
Collaborator

fkuehlein commented Jul 15, 2024

Warning has been showing up since Travis Windows builds were established:

tests/test_generic.py::test_init_str
C:\Users\travis\build\pik-copan\pyunicorn\src\pyunicorn\climate\partial_correlation.py:131: RuntimeWarning: divide by zero encountered in divide

    return - C_inv / norm

tests/test_generic.py::test_init_str

  C:\Users\travis\build\pik-copan\pyunicorn\src\pyunicorn\climate\partial_correlation.py:131: RuntimeWarning: invalid value encountered in divide

    return - C_inv / norm

What test_init_str() does there is basically just

from pyunicorn.climate import ClimateData, PartialCorrelationClimateNetwork

PartialCorrelationClimateNetwork(ClimateData.SmallTestData(), winter_only=False, threshold=.2)

which doesn't produce any warning on my macOS, as there are no zeros or NaNs in the denominator. This might indicate a bug on windows, a test should therefore be added to back up test_init_str() and check whether the method produces correct results on all platforms.

@fkuehlein fkuehlein added the bug label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant