Skip to content

Commit 58434f7

Browse files
committed
TST: Add dev numpy to devdeps
BUG: Compat with numpy 1.24.0rc1
1 parent 6b2ffb0 commit 58434f7

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

specreduce/core.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ def _parse_image(self, image, disp_axis=1):
7575
spectral_axis = getattr(image, 'spectral_axis',
7676
np.arange(img.shape[disp_axis]) * u.pix)
7777

78+
if mask.ndim == np.ma.nomask:
79+
mask = np.zeros(img.shape, dtype=bool) # 0 = good
80+
7881
return Spectrum1D(img * unit, spectral_axis=spectral_axis,
7982
uncertainty=uncertainty, mask=mask)
8083

specreduce/extract.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ def _parse_image(self, image,
359359
else:
360360
mask = np.ma.masked_invalid(img).mask
361361

362+
if mask.ndim == np.ma.nomask:
363+
mask = np.zeros(img.shape, dtype=bool) # 0 = good
364+
362365
if img.shape != mask.shape:
363366
raise ValueError('image and mask shapes must match.')
364367

tox.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ isolated_build = true
1515
# Pass through the following environment variables which may be needed for the CI
1616
passenv = HOME WINDIR LC_ALL LC_CTYPE CC CI
1717

18+
setenv =
19+
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scipy-wheels-nightly/simple
20+
1821
# Run the tests in a temporary directory to make sure that we don't import
1922
# this package from the source tree
2023
changedir = .tmp/{envname}
@@ -50,6 +53,7 @@ deps =
5053
astropy50: astropy==5.0.*
5154
astropylts: astropy==5.0.*
5255

56+
devdeps: numpy>=0.0.dev0
5357
devdeps: git+https://github.com/astropy/astropy.git#egg=astropy
5458
devdeps: git+https://github.com/astropy/specutils.git#egg=specutils
5559

0 commit comments

Comments
 (0)