Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpecutilsExtension ASDF extension interferes with url_mapping of other ASDF extensions (astropy, jwst) #465

Closed
jdavies-st opened this issue May 16, 2019 · 3 comments · Fixed by #500

Comments

@jdavies-st
Copy link
Contributor

jdavies-st commented May 16, 2019

When running the JWST pipeline on JWST data while having the current dev version of specutils installed

specutils-0.5.2.dev45+gb873f2a|           py36_3         146 KB  http://ssb.stsci.edu/conda-dev

the specutils ASDF extension is somehow interfering with the astropy ASDF extension and remapping the location of baseframe-1.0.0.yaml to a non-existent location in the specutils package.

The correct location for this schema is in the astropy package.

The tag

tag:astropy.org:astropy/coordinates/frames/baseframe-1.0.0

should get mapped to the local installation of astropy:

astropy/io/misc/asdf/data/schemas/astropy.org/astropy/coordinates/frames/baseframe-1.0.0.yaml:

but specutils is somehow interfering and mapping it to

specutils/io/asdf/schemas/astropy.org/astropy/coordinates/frames/baseframe-1.0.0.yaml

Not good.

I don't see this bug in the last released version, specutils==0.5.2. So this only seems to be a problem in dev right now.

Full traceback below.

traceback.txt

Tagging @nden.

@jdavies-st
Copy link
Contributor Author

Here's a simple way to reproduce what is essentially the same bug if the dev version of specutils is installed.

In [3]: import asdf

In [4]: from astropy.coordinates import FK5

In [5]: frame = FK5()

In [7]: af = asdf.AsdfFile()

In [8]: af.tree = {'frame': frame}
/Users/jdavies/miniconda3/envs/jwst_dev/lib/python3.6/site-packages/asdf/schema.py:236: 
UserWarning: Unable to locate schema file for 'tag:astropy.org:astropy/coordinates/frames/fk5-1.0.0': 'file:///Users/jdavies/miniconda3/envs/jwst_dev/lib/python3.6/site-packages/specutils/io/asdf/schemas/astropy.org/astropy/coordinates/frames/fk5-1.0.0.yaml'
  warnings.warn(msg.format(tag, schema_path))

@jdavies-st
Copy link
Contributor Author

It looks like the bug was introduced here

#443

and is probably in the url_mapping in the extension.py module.

SPECUTILS_URL_MAPPING = [
(ASTROPY_SCHEMA_URI_BASE,
filepath_to_url(
os.path.join(SCHEMA_PATH, 'astropy.org')) +
'/{url_suffix}.yaml')]

@jdavies-st
Copy link
Contributor Author

I will add that this bug currently breaks all ASDF tag and schema functionality for asdf, astropy and jwst if the current dev version of specutils is installed with these other packages. So this bug is critical to get fixed before the next release of specutils happens. Please label and milestone this appropriately.

@jdavies-st jdavies-st changed the title SpecutilsExtension ASDF extension gives wrong mapping to baseframe-1.0.0.yaml SpecutilsExtension ASDF extension interferes with url_mapping of other ASDF extensions (astropy, jwst) Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant