-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: SciPy test failures due to changes in NumPy main or Python 3.11 #22006
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
Comments
Wheels are built from the main branch on a weekly basis and are available at https://anaconda.org/scipy-wheels-nightly/numpy/files |
Thanks @charris. I installed from the latest wheel, but it looks like it doesn't have the breaking change. Looks like I'll need to wait for a few days. In the meantime, if someone would be willing to run the snippet and report the result, I'd appreciate it. |
#21993 was meant to fix an issue that cropped up after |
You could try manually editing this change into the NumPy you have to see if it fixes the problem. |
I tried this with my ipython session
This is with python 3.9. Perhaps you need a newer python version to reproduce the error? I think there was a change to nan-handling at python 3.10, but I don't know the details. |
I managed to successfully bisect this which identified 6d77c59 as the source of the failures. FWIW the MRE in the OP didn't recreate the error (on either Python 3.9 or 3.10), I used the scipy test suite to bisect, i.e. at each step I ran My guess is this is indeed a masked array issue, and not related to Python nan handling. Relevant version info from the bisection:
|
Thanks. As I mentioned in the OP, I wasn't sure whether the snippet would reproduce the issue or not. Now that I know that it does not, perhaps I can dig a little more to see what is really going on. |
Ah, I can reproduce the issue now. I will try to post a real MWE involving only NumPy. |
Well this is not the main issue, but it is unusual import numpy as np
a = np.ma.array(1, mask=True).sum() # or np.ma.masked
b = (np.nan, np.nan)
np.testing.assert_array_equal(a, b) Passes on both versions of NumPy (1.21.2 an the most recent weekly wheel). Actually, |
OK here we go. It doesn't just involve NumPy, unfortunately, but there is a behavior that was changed recently: import numpy as np
from scipy import special
df = np.ma.array([1])
t = np.ma.masked
special.stdtr(df, t) This used to produce a masked array with the only element masked; now it produces an unmasked A little simpler: import numpy as np
import scipy.special
special.ndtr(np.ma.masked) # was `masked`, now `0.5` |
Is there still an issue here? The change to use |
Closing, @mdhaber please ping if there was something remaining, but I think we reverted the change and both the NumPy and SciPy releases are long ago by now. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the issue:
Some SciPy tests involving masked arrays have been failing since ~7/15 (e.g. see CI in scipy/scipy#16610). It looks like some of the failures are resolved by gh-21977, but there are some that remain.
I am having trouble creating a MWE involving only NumPy because I haven't been successful at building NumPy main. I hope someone with (any relatively modern version of) SciPy and NumPy main can help me find one.
This test below passes in NumPy 1.21.2, but I believe it will fail with NumPy main. Can someone confirm and tell me what the value of
res
is in NumPy main?Reproduce the code example:
Error message:
NumPy/Python version information:
1.21.2 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)]
The text was updated successfully, but these errors were encountered: