From 5ae74cbee1fba25818af25693058781c704ad658 Mon Sep 17 00:00:00 2001 From: Clare Shanahan Date: Fri, 6 Sep 2024 15:14:18 -0400 Subject: [PATCH] require specutils >= 1.16.0 (#3184) * require specutils >= 1.16.0 * specutils 1.16.0 --- CHANGES.rst | 3 +++ .../moment_maps/tests/test_moment_maps.py | 19 ++++++------------- pyproject.toml | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 9f02912f97..1aea7de067 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -157,6 +157,9 @@ Specviz2d Other Changes and Additions --------------------------- +- Bump required specutils version to 1.16. Moment 0 calculation is now in units + of flux*dx (rather than flux) [#3184] + 3.11 (unreleased) ================= diff --git a/jdaviz/configs/cubeviz/plugins/moment_maps/tests/test_moment_maps.py b/jdaviz/configs/cubeviz/plugins/moment_maps/tests/test_moment_maps.py index afe9fa9984..90b35bb3db 100644 --- a/jdaviz/configs/cubeviz/plugins/moment_maps/tests/test_moment_maps.py +++ b/jdaviz/configs/cubeviz/plugins/moment_maps/tests/test_moment_maps.py @@ -11,8 +11,6 @@ from glue.core.roi import XRangeROI from numpy.testing import assert_allclose -from jdaviz.configs.cubeviz.plugins.moment_maps.moment_maps import SPECUTILS_LT_1_15_1 - def test_user_api(cubeviz_helper, spectrum1d_cube): with warnings.catch_warnings(): @@ -51,12 +49,9 @@ def test_user_api(cubeviz_helper, spectrum1d_cube): def test_moment_calculation(cubeviz_helper, spectrum1d_cube, tmp_path): - if SPECUTILS_LT_1_15_1: - moment_unit = "Jy" - moment_value_str = "+8.00000e+00" - else: - moment_unit = "Jy m" - moment_value_str = "+6.40166e-10" + + moment_unit = "Jy m" + moment_value_str = "+6.40166e-10" dc = cubeviz_helper.app.data_collection with warnings.catch_warnings(): @@ -295,11 +290,9 @@ def test_momentmap_nirspec_prism(cubeviz_helper, tmp_path): (sky_cube.ra.deg, sky_cube.dec.deg)) -def test_correct_output_spectral_y_units(cubeviz_helper, spectrum1d_cube_custom_fluxunit): - if SPECUTILS_LT_1_15_1: - moment_unit = "Jy / sr" - else: - moment_unit = "Jy m / sr" +def test_correct_output_flux_or_sb_units(cubeviz_helper, spectrum1d_cube_custom_fluxunit): + + moment_unit = "Jy m / sr" # test that the output unit labels in the moment map plugin reflect any # changes made in the unit conversion plugin. diff --git a/pyproject.toml b/pyproject.toml index 7e36a8b63c..39a7adfc47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ dependencies = [ "ipywidgets>=8.0.6", "solara>=1.39.0", "pyyaml>=5.4.1", - "specutils>=1.15", + "specutils>=1.16", "specreduce>=1.4.1", "photutils>=1.4", "glue-astronomy>=0.10",