You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
generate_percentiles test fails on improver_conda_forge env #2351
Running the acceptance tests using the conda-forge.yml environment is failing on acceptance/test_generate_percentiles.py, specifically the test_masked_percentiles test; the test output differs from the kgo at a selection of points.
I've tracked down the issue to the fact that fast_interp_same_y and slow_interp_same_y return slightly different results, with the fast variant the preferred option (which was used to generate the data), but the slow variant being used in the conda-forge environment as numba is not available.
A minimal example that highlights the issue is the following:
x = [[0.25, 0.5, 0.75],]
xp = [[0, 0.5, 0.5, 0.833333, 1],]
fp = [[-4000. 0 .152. 15000. 20000.],]
The slow variant returns: [-2000. 152. 11288.001] while the fast variant return [-2000. 0. 11288.001]. The issue comes down to how the values are interpolated on the interval with degenerate probability values.
Acceptance criteria:
fast_interp_same_y and slow_interp_same_y produce equivalent outputs
A workaround could be to change the code (for both fast and slow methods) to remove duplicate xp values (and corresponding fp values) before interpolating.
Activity
btrotta-bom commentedon Apr 2, 2026
In general, interpolation is not well-defined when xp contains duplicate values, e.g. see the warning here: https://numpy.org/devdocs/reference/generated/numpy.interp.html
A workaround could be to change the code (for both fast and slow methods) to remove duplicate xp values (and corresponding fp values) before interpolating.