From 299308eb88583d74c8c9e6091d48c643048015ed Mon Sep 17 00:00:00 2001 From: gibsongreen Date: Tue, 19 Mar 2024 16:07:26 -0400 Subject: [PATCH] unexpose translate_units() from user --- .../plugins/spectral_extraction/spectral_extraction.py | 2 +- .../spectral_extraction/tests/test_spectral_extraction.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py b/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py index 4aa5b43a0f..20beb89de9 100644 --- a/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py +++ b/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py @@ -160,7 +160,7 @@ def user_api(self): expose = ['function', 'spatial_subset', 'aperture', 'add_results', 'collapse_to_spectrum', 'wavelength_dependent', 'reference_wavelength', - 'aperture_method', 'translate_units'] + 'aperture_method'] if self.dev_bg_support: expose += ['background', 'bg_wavelength_dependent'] diff --git a/jdaviz/configs/cubeviz/plugins/spectral_extraction/tests/test_spectral_extraction.py b/jdaviz/configs/cubeviz/plugins/spectral_extraction/tests/test_spectral_extraction.py index 9220740580..4b2cd9aa2e 100644 --- a/jdaviz/configs/cubeviz/plugins/spectral_extraction/tests/test_spectral_extraction.py +++ b/jdaviz/configs/cubeviz/plugins/spectral_extraction/tests/test_spectral_extraction.py @@ -405,13 +405,13 @@ def test_unit_translation(cubeviz_helper): # store to test second time after calling translate_units mjy_sr_data1 = collapsed_spec._data[0] - extract_plg.translate_units(collapsed_spec) + extract_plg._obj.translate_units(collapsed_spec) assert collapsed_spec._unit == u.MJy / u.sr # some value in MJy/sr that we know the outcome after translation assert np.allclose(collapsed_spec._data[0], 8751.653) - extract_plg.translate_units(collapsed_spec) + extract_plg._obj.translate_units(collapsed_spec) # translating again returns the original units assert collapsed_spec._unit == u.Jy / u.pix