Skip to content

Commit

Permalink
Backport PR spacetelescope#2463: Revert "TST: Ignore ASDF warning abo…
Browse files Browse the repository at this point in the history
…ut gwcs-1.0.0 schema"
  • Loading branch information
pllim authored and meeseeksmachine committed Sep 15, 2023
1 parent 4c9d6af commit b6d0f80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
9 changes: 2 additions & 7 deletions jdaviz/configs/imviz/tests/test_astrowidgets_api.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import os
import warnings

import asdf
import numpy as np
import pytest
from asdf.exceptions import AsdfWarning
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.nddata import NDData
Expand Down Expand Up @@ -355,11 +353,8 @@ def test_mvp_markers(self):
def test_markers_gwcs_lonlat(imviz_helper):
"""GWCS uses Lon/Lat for ICRS."""
gw_file = get_pkg_data_filename('data/miri_i2d_lonlat_gwcs.asdf')
with warnings.catch_warnings():
# https://github.com/spacetelescope/jdaviz/issues/2446
warnings.filterwarnings("ignore", category=AsdfWarning)
with asdf.open(gw_file) as af:
gw = af.tree['wcs']
with asdf.open(gw_file) as af:
gw = af.tree['wcs']
ndd = NDData(np.ones((10, 10), dtype=np.float32), wcs=gw, unit='MJy/sr')
imviz_helper.load_data(ndd, data_label='MIRI_i2d')
assert imviz_helper.app.data_collection[0].label == 'MIRI_i2d[DATA]'
Expand Down
12 changes: 2 additions & 10 deletions jdaviz/configs/mosviz/tests/test_parsers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import warnings
from zipfile import ZipFile

import pytest
from numpy.testing import assert_allclose
from asdf.exceptions import AsdfWarning
from astropy.utils.data import download_file

from jdaviz.utils import PRIHDR_KEY, COMMENTCARD_KEY
Expand Down Expand Up @@ -99,10 +97,7 @@ def test_nirspec_level2_parser(mosviz_helper, tmp_path):
level3_path = tmp_path / 'jw02756001001_03103_00003_nrs1'

data_dir = level3_path
with warnings.catch_warnings():
# https://github.com/spacetelescope/jdaviz/issues/2446
warnings.filterwarnings("ignore", category=AsdfWarning)
mosviz_helper.load_data(directory=data_dir, instrument='nirspec')
mosviz_helper.load_data(directory=data_dir, instrument='nirspec')

assert len(mosviz_helper.app.data_collection) == 75

Expand Down Expand Up @@ -130,10 +125,7 @@ def test_niriss_parser(mosviz_helper, tmp_path):
with ZipFile(fn, 'r') as sample_data_zip:
sample_data_zip.extractall(tmp_path)

with warnings.catch_warnings():
# https://github.com/spacetelescope/jdaviz/issues/2446
warnings.filterwarnings("ignore", category=AsdfWarning)
mosviz_helper.load_data(directory=tmp_path, instrument="niriss")
mosviz_helper.load_data(directory=tmp_path, instrument="niriss")
assert len(mosviz_helper.app.data_collection) == 10

# The MOS Table should be first in the data collection
Expand Down

0 comments on commit b6d0f80

Please sign in to comment.