Skip to content

Commit

Permalink
numpy deprecation warning filter for v1.24.0 (#1873)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
bmorris3 and pllim authored Nov 29, 2022
1 parent ec88355 commit 0b76ee4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions jdaviz/configs/cubeviz/plugins/slice/tests/test_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions jdaviz/configs/mosviz/plugins/slit_overlay/slit_overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0b76ee4

Please sign in to comment.