-
Notifications
You must be signed in to change notification settings - Fork 158
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
More MaskedNDArray
failures with Astropy 5.0
#1161
Comments
Thanks for reporting this @dhomeier! It looks like 9 separate tests failed in total. We'll probably have to debug one by one. |
I'm just going to loop @mhvk into this issue as I wonder if some of these are issues with the new masked quantity class? |
Several of the failing tests can be narrowed down to the >>> import numpy as np
>>> from astropy.utils.masked import Masked
>>> notmasked = np.zeros(3, dtype=bool)
>>> masked = Masked(notmasked)
>>> notmasked &= masked
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/var/folders/x4/y38zs5fj4szf7xj3354kv74m0000gn/T/ipykernel_23575/1983679778.py in <module>
3 notmasked = np.zeros(3, dtype=bool)
4 masked = Masked(notmasked)
----> 5 notmasked &= masked
~/Library/Caches/pypoetry/virtualenvs/lightkurve-HqDeGDfc-py3.8/lib/python3.8/site-packages/astropy/utils/masked/core.py in __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
657 # TODO: allow writing to unmasked output if nothing is masked?
658 if d is not None:
--> 659 raise TypeError('cannot write to unmasked output')
660 elif out_mask is None:
661 out_mask = m
TypeError: cannot write to unmasked output |
I think it's a decision to err on the safe side since the output could not be written to I think for this to work in its current state, |
|
@barentsen - indeed, I was looking and thinking similarly. As @dhomeier notes,
p.s. Just to be sure: is the whole EDIT: I think the |
Excellent question! Of course most of this code was written in a world where |
Great! Feel free to ping if there are issues. I'll look into |
@mhvk I noticed the following issue while debugging one of the tests: astropy/astropy#12481 (It's easy enough to work around this, but it looked like a genuine albeit obscure issue to me.) |
@mhvk @barentsen - just to check, should I consider the issues here blockers for the astropy 5.0 release or can I go ahead and release and we fix these in 5.0.1? |
@astrofrog I haven't seen anything that should block a 5.0 release from my perspective! |
Problem description
Found a couple more test failures with astropy 5.0rc2 that I missed previously (likely were present with 5.0rc1 as well, but I did not test with remote-data). All passing with 4.3.1 in the same environment; I have not looked into details, but they all seem in some way related to handling
MaskedNDArray
(rather than unmasked NDData ornp.ma.array
) now.The first test e.g. could be fixed by substituting
assert np.isnan(getattr(lc.flux, 'data', lc.flux)).any() # ensure the test data has nan in flux
Example
Environment
Platform: macOS-10.14.6-x86_64-i386-64bit
Python 3.9.8, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
Astropy: 5.0rc2
Matplotlib: 3.5.0rc1
Freetype: 2.6.1
rootdir: ~/git/lightkurve, configfile: pyproject.toml, testpaths: tests, src
plugins: filter-subpackage-0.1.1, arraydiff-0.3, xdist-2.1.0, astropy-header-0.1.2, cov-2.10.1, flaky-3.7.0, remotedata-0.3.2, mock-3.3.1, asdf-2.8.1, forked-1.3.0, openfiles-0.5.0, mpl-0.11, expect-1.1.0, hypothesis-6.14.2, doctestplus-0.10.1, flake8-1.0.6
lightkurve version: 2.0.12dev
Installation method: git main @ 70d1c4c
The text was updated successfully, but these errors were encountered: