pysal / libpysal

Core components of Python Spatial Analysis Library
http://pysal.org/libpysal
Other
249 stars 79 forks source link

[CI] precision failure on `ubuntu-latest, ci/312-no-optional.yaml` [2024-06-19] #724

Closed jGaboardi closed 2 weeks ago

jGaboardi commented 2 weeks ago

xref: https://github.com/pysal/libpysal/pull/723#issuecomment-2179083457

ubuntu-latest, ci/312-no-optional.yaml precision failure in libpysal/graph/tests/test_triangulation.py::test_kernel:

FAILED libpysal/graph/tests/test_triangulation.py::test_kernel - AssertionError: 
Arrays are not almost equal to 6 decimals

Mismatched elements: 10 / 16 (62.5%)
Max absolute difference among violations: 0.11081333
Max relative difference among violations: 3.10992407
 ACTUAL: array([0.130562, 0.173591, 0.223128, 0.130562, 0.133965, 0.032596,
       0.173591, 0.133965, 0.069481, 0.180294, 0.032596, 0.069481,
       0.020043, 0.223128, 0.180294, 0.020043])
 DESIRED: array([0.130562, 0.173591, 0.223128, 0.133965, 0.032596, 0.130562,
       0.133965, 0.173591, 0.180294, 0.069481, 0.020043, 0.032596,
       0.069481, 0.223128, 0.180294, 0.020043])
martinfleis commented 2 weeks ago

I think it is actually sorting issue. All the values are there but shifted. That feels dangerous.

martinfleis commented 2 weeks ago

Fun, I can't reproduce it locally. Must be linux only. Will try later.

martinfleis commented 2 weeks ago

So far I can confirm that this is related to numpy 2 and that running the test with 1.26.4 does not show any deprecation warnings or indication that something should change. And that I am able to reproduce it on ubuntu but not on apple silicon.