From 14f48c65d1b1016c6d92b58fa25b13026cc55471 Mon Sep 17 00:00:00 2001 From: ojustino Date: Tue, 22 Nov 2022 11:46:10 -0500 Subject: [PATCH] Bump specutils requirement to v1.9.1 --- setup.cfg | 2 +- specreduce/background.py | 2 -- specreduce/tests/test_background.py | 13 +++++-------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/setup.cfg b/setup.cfg index 673d111b..2bed71fe 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,7 +18,7 @@ python_requires = >=3.8 setup_requires = setuptools_scm install_requires = astropy - specutils>=1.7 + specutils>=1.9.1 synphot matplotlib photutils diff --git a/specreduce/background.py b/specreduce/background.py index e6aac876..59395b00 100644 --- a/specreduce/background.py +++ b/specreduce/background.py @@ -324,6 +324,4 @@ def __rsub__(self, image): """ Subtract the background from an image. """ - # NOTE: will not be called until specutils PR #988 is merged, released, - # and pinned here return self.sub_image(image) diff --git a/specreduce/tests/test_background.py b/specreduce/tests/test_background.py index 2182ae4a..558969dd 100644 --- a/specreduce/tests/test_background.py +++ b/specreduce/tests/test_background.py @@ -55,20 +55,17 @@ def test_background(): bg = Background(image, trace, width=bkg_width) # test that image subtraction works - # NOTE: uncomment sub1 test once Spectrum1D and Background subtraction works - # (meaning specutils PR #988 is merged, released, and pinned here) - # sub1 = image - bg1 + sub1 = image - bg1 sub2 = bg1.sub_image(image) sub3 = bg1.sub_image() - # assert np.allclose(sub1.flux, sub2.flux) + assert np.allclose(sub1.flux, sub2.flux) assert np.allclose(sub2.flux, sub3.flux) - # NOTE: uncomment sub4 test once Spectrum1D and Background subtraction works - # sub4 = image_um - bg4 + sub4 = image_um - bg4 sub5 = bg4.sub_image(image_um) sub6 = bg4.sub_image() - assert np.allclose(sub2.flux, sub5.flux) - # assert np.allclose(sub4.flux, sub5.flux) + assert np.allclose(sub1.flux, sub4.flux) + assert np.allclose(sub4.flux, sub5.flux) assert np.allclose(sub5.flux, sub6.flux) bkg_spec = bg1.bkg_spectrum()