-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
stats.sigma_clipped_stats raises numpy warning when called with MaskedColumn #13281
Comments
Confirmed this happens on -dev and does not happen on 5.0.4. Though it is all rather weird, as it originates in older code. The error itself definitely comes from numpy:
And it is clear where the difference between astropy/astropy/stats/sigma_clipping.py Lines 403 to 405 in 2288ecd
Here, for a A really simple change is to change But let me ping @larrybradley since I'm wondering whether this is wanted. p.s. For completeness, the
|
I think that make sense. |
Description
astropy.stats.sigma_clipped_stats
raises a warning that the mask is ignored, when called with aastropy.table.MaskedColumn
. However, that warning is wrong - that mask is used.Not sure it's related: #5303
Expected behavior
not issue a warning that warns of something that does not happen
Actual behavior
warning issued for something that does not happen
Steps to Reproduce
produces the following output:
(2.5555555555555554, 3.0, 0.8314794192830981)
The following code produces the same output, but raises a warning that the mask is ignored. The mask is most definitely is not ignored, otherwise the output would be different.
gives the following warning:
Curiously, the following is True:
isinstance(col, np.ma.MaskedArray)
, so I would have expectedarr
andcol
to not just give the same numerical result, but also to have or have not the same warning.System Details
macOS-12.4-arm64-arm-64bit
Python 3.10.1 | packaged by conda-forge | (main, Dec 22 2021, 01:39:07) [Clang 11.1.0 ]
Numpy 1.22.0
pyerfa 2.0.0.1
astropy 5.1
Scipy 1.7.3
Matplotlib 3.5.1
CC: @mhvk
The text was updated successfully, but these errors were encountered: