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

TimeInterpolator tests fail because of changes to scipy.interpolation.interp1d #162

Open
mdpiper opened this issue Oct 13, 2022 · 1 comment

Comments

@mdpiper
Copy link
Member

mdpiper commented Oct 13, 2022

Two TimeInterpolator tests are failing. The traceback:

===================================== FAILURES ======================================
__________________________ test_interp_outside_range[next] __________________________
Traceback (most recent call last):
  File "/home/mpiper/projects/pymt/tests/framework/test_timeinterp.py", line 88, in test_interp_outside_range
    assert np.isfinite(interp(4.5)) and interp(4.5) >= 4.0
AssertionError: assert (False)
 +  where False = <ufunc 'isfinite'>(array(nan))
 +    where <ufunc 'isfinite'> = np.isfinite
 +    and   array(nan) = <pymt.framework.timeinterp.TimeInterpolator object at 0x7fe5596021a0>(4.5)
_________________________ test_interp_below_range[previous] _________________________
Traceback (most recent call last):
  File "/home/mpiper/projects/pymt/tests/framework/test_timeinterp.py", line 96, in test_interp_below_range
    assert np.isfinite(interp(-0.5)) and interp(-0.5) >= 4.0
AssertionError: assert (False)
 +  where False = <ufunc 'isfinite'>(array(nan))
 +    where <ufunc 'isfinite'> = np.isfinite
 +    and   array(nan) = <pymt.framework.timeinterp.TimeInterpolator object at 0x7fe5596012a0>(-0.5)

The problem lies with the behavior of the previous and next methods of scipy.interpolate.interp1d, which TimeInterpolator uses. The issue scipy/scipy#16997 explains the old (scipy<1.9) and new (scipy>=1.9) behavior of these methods. It looks like the new behavior is expected, so we'll need to update our tests.

@mdpiper
Copy link
Member Author

mdpiper commented Feb 3, 2023

A workaround is to require scipy<1.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant