Skip to content

Commit

Permalink
Merge a61f016 into 5d4c3fb
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavies-st committed Aug 5, 2019
2 parents 5d4c3fb + a61f016 commit 1e92a41
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ matrix:

# Try development version of Astropy
- os: linux
env: ASTROPY_VERSION=dev "PIP_DEPENDENCIES=$GWCS_DEV $ASDF_DEV"
env: ASTROPY_VERSION=dev "PIP_DEPENDENCIES=scipy $GWCS_DEV $ASDF_DEV"

allow_failures:
# Try development version of Astropy
- os: linux
env: ASTROPY_VERSION=dev "PIP_DEPENDENCIES=$GWCS_DEV $ASDF_DEV"
env: ASTROPY_VERSION=dev "PIP_DEPENDENCIES=scipy $GWCS_DEV $ASDF_DEV"


install:
Expand Down
10 changes: 10 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from importlib.util import find_spec
import pkg_resources

entry_points = []
for entry_point in pkg_resources.iter_entry_points('pytest11'):
entry_points.append(entry_point.name)

if "asdf_schema_tester" not in entry_points and find_spec('asdf') is not None:
pytest_plugins = ['asdf.tests.schema_tester']

2 changes: 0 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,3 @@ github_project = astropy/specutils
install_requires = astropy>=3.1, gwcs, scipy
# version should be PEP440 compatible (http://www.python.org/dev/peps/pep-0440)
version = 0.6.dev

[entry_points]
1 change: 0 additions & 1 deletion specutils/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

# Use ASDF schema tester plugin if ASDF is installed
if find_spec('asdf') is not None:
pytest_plugins = ['asdf.tests.schema_tester']
PYTEST_HEADER_MODULES['Asdf'] = 'asdf'

# Uncomment the following lines to display the version number of the
Expand Down
5 changes: 3 additions & 2 deletions specutils/io/asdf/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Defines extension that is used by ASDF for recognizing specutils types
"""
import os
import urllib

from asdf.util import filepath_to_url
from asdf.extension import AsdfExtension
Expand All @@ -15,9 +16,9 @@
SCHEMA_PATH = os.path.abspath(
os.path.join(os.path.dirname(__file__), 'schemas'))
SPECUTILS_URL_MAPPING = [
(ASTROPY_SCHEMA_URI_BASE,
(urllib.parse.urljoin(ASTROPY_SCHEMA_URI_BASE, 'specutils/'),
filepath_to_url(
os.path.join(SCHEMA_PATH, 'astropy.org')) +
os.path.join(SCHEMA_PATH, 'astropy.org', 'specutils')) +
'/{url_suffix}.yaml')]


Expand Down
10 changes: 10 additions & 0 deletions specutils/io/asdf/tags/tests/test_spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import numpy as np

import astropy.units as u
from astropy.coordinates import FK5

from asdf.tests.helpers import assert_roundtrip_tree
import asdf

from specutils import Spectrum1D, SpectrumList

Expand Down Expand Up @@ -46,3 +48,11 @@ def test_asdf_spectrumlist(tmpdir):

tree = dict(spectra=spectra)
assert_roundtrip_tree(tree, tmpdir)


@pytest.mark.filterwarnings("error::UserWarning")
def test_asdf_url_mapper():
"""Make sure specutils asdf extension url_mapping doesn't interfere with astropy schemas"""
frame = FK5()
af = asdf.AsdfFile()
af.tree = {'frame': frame}
2 changes: 1 addition & 1 deletion specutils/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This module tests SpecUtils io routines
"""

from ..io.parsing_utils import generic_spectrum_from_table # or something like that
from specutils.io.parsing_utils import generic_spectrum_from_table # or something like that
from astropy.io import registry
from astropy.table import Table
from astropy.utils.exceptions import AstropyUserWarning
Expand Down

0 comments on commit 1e92a41

Please sign in to comment.