Skip to content

Commit 2a877a9

Browse files
committed
Fix error in test
new_data never has a .data the way the test is written
1 parent aedb3b2 commit 2a877a9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ccdproc/tests/test_cosmicray.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
22

3+
import array_api_extra as xpx
34
import pytest
45
from astropy import units as u
56
from astropy.nddata import StdDevUncertainty
@@ -107,9 +108,9 @@ def test_cosmicray_gain_correct(array_input, gain_correct_data):
107108
cr_mask = new_ccd.mask
108109
# Fill masked locations with 0 since there is no simple relationship
109110
# between the original value and the corrected value.
110-
# Masking using numpy is a handy way to check the results here.
111-
orig_data = xp.asarray(np_ma_array(ccd_data.data, mask=cr_mask).filled(0))
112-
new_data = xp.asarray(np_ma_array(new_data.data, mask=cr_mask).filled(0))
111+
orig_data = xpx.at(ccd_data.data)[cr_mask].set(0.0)
112+
new_data = xpx.at(new_data)[cr_mask].set(0.0)
113+
113114
if gain_correct_data:
114115
gain_for_test = gain
115116
else:

0 commit comments

Comments
 (0)