Skip to content

Commit 48ecb92

Browse files
committed
Adjust tolerances to accommodate results on NumPy 2 as well as 1:
Tiny numbers of pixels differing by ~0.1% after the extraction step (depending on the NumPy 2.x version and whether my NDData #18392 patches are applied). Small diffs in VAR only after NDData arithmetic.
1 parent 31ace3c commit 48ecb92

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

geminidr/ghost/recipes/sq/tests/test_reduce_arc.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,12 @@ def test_reduce_arc(input_filename, caldict, arm, path_to_inputs, path_to_refs):
6262
adout = astrodata.open(os.path.join("calibrations", "processed_arc", output_filename))
6363
adref = astrodata.open(os.path.join(path_to_refs, output_filename))
6464
# Changed timestamp kw from STCKARCS -> STACKARC and don't have time to
65-
# re-upload reference, so just add these to the "ignore" list
66-
assert ad_compare(adref, adout, ignore_kw=['PROCARC', 'STACKARC', 'STCKARCS'])
65+
# re-upload reference, so just add these to the "ignore" list.
66+
# The max_miss arg accommodates just a few pixels with large (~0.1%) diffs
67+
# between NumPy 1 & 2 after the extraction step, while rtol allows for
68+
# ~1e-7 rounding differences in VAR after NDData arithmetic on NumPy 2.
69+
assert ad_compare(adref, adout, max_miss=12, rtol=1e-6,
70+
ignore_kw=['PROCARC', 'STACKARC', 'STCKARCS'])
6771

6872
# Need to evaluate WFIT
6973
arm = GhostArm(arm=adout.arm(), mode=adout.res_mode())

geminidr/ghost/recipes/sq/tests/test_reduce_flat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def test_reduce_flat(change_working_dir, input_filename, bias, arm,
5757
output_filename = p.streams['main'][0].filename
5858
adout = astrodata.open(os.path.join("calibrations", "processed_flat", output_filename))
5959
adref = astrodata.open(os.path.join(path_to_refs, output_filename))
60-
assert ad_compare(adref, adout, ignore_kw=['PROCFLAT'])
60+
assert ad_compare(adref, adout, rtol=1e-6, ignore_kw=['PROCFLAT'])
6161

6262
# Comparison doesn't include "exotic" extensions
6363
assert hasattr(adout[0], "BLAZE")

geminidr/ghost/recipes/sq/tests/test_reduce_slit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ def test_reduce_slit_science(input_filename, caldict, path_to_inputs,
8888
for output_filename in [ad.filename for ad in p.streams['main']]:
8989
adout = astrodata.open(os.path.join("calibrations", "processed_slit", output_filename))
9090
adref = astrodata.open(os.path.join(path_to_refs, output_filename))
91-
assert ad_compare(adref, adout, ignore_kw=['PRSLITIM'])
91+
assert ad_compare(adref, adout, rtol=1e-6, ignore_kw=['PRSLITIM'])

0 commit comments

Comments
 (0)