Skip to content

Change in precision of stable entropy bins with NumPy>=1.25.0 #166

@rhugonnet

Description

@rhugonnet

Identified in #160. Tracked down that the change happens since NumPy 1.25.0 (CI fails for above, but not any of the 1.24.X or older), but we currently have no idea which function exactly triggers it... As only Python 3.9/3.10 use these most recent NumPy versions in CI, this is where tests fail with:

 =========================== short test summary info ============================
FAILED skgstat/tests/test_variogram.py::TestVariogramArguments::test_binning_method_stable - AssertionError: 
Arrays are not almost equal to 1 decimals

Mismatched elements: 5 / 10 (50%)
Max absolute difference: 0.21285498
Max relative difference: 0.03980185
 x: array([ 4.1,  8.6, 12.8, 17.2, 21.6, 25.2, 29.9, 33.1, 38.7, 43. ])
 y: array([ 4.3,  8.4, 12.8, 17.1, 21.4, 25.2, 29.9, 33.2, 38.5, 42.8])
FAILED skgstat/tests/test_variogram.py::TestVariogramArguments::test_binning_method_stable_fix_bins - AssertionError: 
Arrays are not almost equal to 1 decimals

Mismatched elements: 3 / 10 (30%)
Max absolute difference: 0.49334201
Max relative difference: 0.01147307
 x: array([ 4.2,  8.5, 12.8, 17.1, 21.3, 25.5, 29.6, 33.4, 37.4, 43.5])
 y: array([ 4.2,  8.6, 12.8, 17.1, 21.2, 25.5, 29.3, 33.2, 37.4, 43. ])
FAILED skgstat/tests/test_variogram.py::TestVariogramArguments::test_binning_method_stable_maxiter - AssertionError: 
Arrays are not almost equal to 1 decimals

Mismatched elements: 5 / 10 (50%)
Max absolute difference: 0.21285498
Max relative difference: 0.03980185
 x: array([ 4.1,  8.6, 12.8, 17.2, 21.6, 25.2, 29.9, 33.1, 38.7, 43. ])
 y: array([ 4.3,  8.4, 12.8, 17.1, 21.4, 25.2, 29.9, 33.2, 38.5, 42.8])

For now, the tests are temporarily fixed by changing test precision from 1 to 0 decimals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions