From 0b76ee4e0fb22ec0b8c4dda7ee49d35faad73289 Mon Sep 17 00:00:00 2001 From: "Brett M. Morris" Date: Tue, 29 Nov 2022 16:18:47 -0500 Subject: [PATCH] numpy deprecation warning filter for v1.24.0 (#1873) * numpy deprecation warning filter for v1.24.0 * Fixing np.float_ type casting * more specific warning for pytest * dodging regex failure * Update setup.cfg * fixing another deprecation warning * Adding np.int0 to filtered warnings * Use built-in float * Make slice test more deterministic Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com> --- jdaviz/configs/cubeviz/plugins/slice/tests/test_slice.py | 6 +++--- jdaviz/configs/mosviz/plugins/slit_overlay/slit_overlay.py | 4 ++-- setup.cfg | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/jdaviz/configs/cubeviz/plugins/slice/tests/test_slice.py b/jdaviz/configs/cubeviz/plugins/slice/tests/test_slice.py index f58d10182b..f5fc537416 100644 --- a/jdaviz/configs/cubeviz/plugins/slice/tests/test_slice.py +++ b/jdaviz/configs/cubeviz/plugins/slice/tests/test_slice.py @@ -72,6 +72,9 @@ def test_slice(cubeviz_helper, spectrum1d_cube): # Test player buttons API + sl.vue_goto_first() + assert sl.slice == 0 + sl.vue_goto_last() assert sl.slice == sl.max_value @@ -89,9 +92,6 @@ def test_slice(cubeviz_helper, spectrum1d_cube): assert not sl._player # NOTE: Hard to check sl.slice here because it is non-deterministic. - sl.vue_goto_first() - assert sl.slice == 0 - def test_indicator_settings(cubeviz_helper, spectrum1d_cube): app = cubeviz_helper.app diff --git a/jdaviz/configs/mosviz/plugins/slit_overlay/slit_overlay.py b/jdaviz/configs/mosviz/plugins/slit_overlay/slit_overlay.py index 892011c2cd..f3aa085cf2 100644 --- a/jdaviz/configs/mosviz/plugins/slit_overlay/slit_overlay.py +++ b/jdaviz/configs/mosviz/plugins/slit_overlay/slit_overlay.py @@ -17,8 +17,8 @@ def jwst_header_to_skyregion(header): s_region = header['S_REGION'] footprint = s_region.split("POLYGON ICRS")[1].split() - ra = np.array(footprint[::2], dtype=np.float) - dec = np.array(footprint[1::2], dtype=np.float) + ra = np.array(footprint[::2], dtype=float) + dec = np.array(footprint[1::2], dtype=float) # Find center of slit cra = (max(ra) + min(ra)) / 2 diff --git a/setup.cfg b/setup.cfg index 5e7b40d74f..48466ad10c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -95,6 +95,9 @@ filterwarnings = ignore:distutils Version classes are deprecated:DeprecationWarning ignore:Passing unrecognized arguments to super:DeprecationWarning ignore:.*With traitlets 4\.1, metadata should be set using the \.tag\(\) method:DeprecationWarning + ignore:.*np\.bool8.*is a deprecated alias for:DeprecationWarning + ignore:.*np\.uint0.*is a deprecated alias for:DeprecationWarning + ignore:.*np\.int0.*is a deprecated alias for:DeprecationWarning ignore::DeprecationWarning:glue ignore::DeprecationWarning:bqplot ignore::DeprecationWarning:bqplot_image_gl