Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ mast

- Switch to use HTTP continuation for partial downloads. [#3448]

jplspec
^^^^^^^

- Moved to linelists/ [#3455]

Infrastructure, Utility and Other Changes and Additions
-------------------------------------------------------
Expand Down
46 changes: 23 additions & 23 deletions astroquery/jplspec/__init__.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
JPL Spectral Catalog
--------------------
JPL Spectral Catalog (Deprecated Location)
-------------------------------------------
.. deprecated:: 0.4.8
The `astroquery.jplspec` module has been moved to `astroquery.linelists.jplspec`.
Please update your imports to use `from astroquery.linelists.jplspec import JPLSpec` instead.
This backward compatibility layer will be removed in a future version.
:author: Giannina Guzman ([email protected])
:author: Miguel de Val-Borro ([email protected])
"""
from astropy import config as _config
This module provides backward compatibility for the old import location.
The JPLSpec module has been reorganized under the linelists subpackage.
For new code, please use::
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astroquery.jplspec`.
"""
server = _config.ConfigItem(
'https://spec.jpl.nasa.gov/cgi-bin/catform',
'JPL Spectral Catalog URL.')

timeout = _config.ConfigItem(
60,
'Time limit for connecting to JPL server.')
from astroquery.linelists.jplspec import JPLSpec
"""
import warnings

conf = Conf()
# Issue deprecation warning
warnings.warn(
"Importing from 'astroquery.jplspec' is deprecated. "
"Please use 'from astroquery.linelists.jplspec import JPLSpec' instead. "
"The old import path will be removed in a future version.",
DeprecationWarning,
stacklevel=2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this is necessary or right. I have no experience playing with stacklevels yet.

)

from .core import JPLSpec, JPLSpecClass
# Import from the new location
from ..linelists.jplspec import JPLSpec, JPLSpecClass, Conf, conf

__all__ = ['JPLSpec', 'JPLSpecClass',
'Conf', 'conf',
]
__all__ = ['JPLSpec', 'JPLSpecClass', 'Conf', 'conf']
33 changes: 33 additions & 0 deletions astroquery/linelists/jplspec/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
JPL Spectral Catalog
--------------------
:author: Giannina Guzman ([email protected])
:author: Miguel de Val-Borro ([email protected])
"""
from astropy import config as _config


class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astroquery.linelists.jplspec`.
"""
server = _config.ConfigItem(
'https://spec.jpl.nasa.gov/cgi-bin/catform',
'JPL Spectral Catalog URL.')

timeout = _config.ConfigItem(
60,
'Time limit for connecting to JPL server.')


conf = Conf()

from .core import JPLSpec, JPLSpecClass

__all__ = ['JPLSpec', 'JPLSpecClass',
'Conf', 'conf',
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import astropy.units as u
from astropy.io import ascii
from ..query import BaseQuery
from ..utils import async_to_sync
from ...query import BaseQuery
from ...utils import async_to_sync
# import configurable items declared in __init__.py
from . import conf
from . import lookup_table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ def get_package_data():
os.path.join('data', 'multi.data')]
paths_data = [os.path.join('data', 'catdir.cat')]

return {'astroquery.jplspec.tests': paths_test,
'astroquery.jplspec': paths_data, }
return {'astroquery.linelists.jplspec.tests': paths_test,
'astroquery.linelists.jplspec': paths_data, }

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from astropy import units as u
from astropy.table import Table
from ...jplspec import JPLSpec
from ....jplspec import JPLSpec

file1 = 'CO.data'
file2 = 'CO_6.data'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from astropy import units as u
from astropy.table import Table

from ...jplspec import JPLSpec
from ....jplspec import JPLSpec


@pytest.mark.remote_data
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ The following modules have been completed using a common API:
ipac/irsa/irsa_dust/irsa_dust.rst
ipac/irsa/ibe/ibe.rst
ipac/irsa/irsa.rst
jplspec/jplspec.rst
linelists/jplspec/jplspec.rst
magpis/magpis.rst
mast/mast.rst
mocserver/mocserver.rst
Expand Down Expand Up @@ -412,7 +412,7 @@ well as cross section and collision rates. Those services are:
atomic/atomic.rst
linelists/cdms/cdms.rst
hitran/hitran.rst
jplspec/jplspec.rst
linelists/jplspec/jplspec.rst
lamda/lamda.rst
nist/nist.rst
splatalogue/splatalogue.rst
Expand Down
18 changes: 9 additions & 9 deletions docs/jplspec/jplspec.rst → docs/linelists/jplspec/jplspec.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _astroquery.jplspec:
.. _astroquery.linelists.jplspec:

*********************************************
JPL Spectroscopy Queries (astroquery.jplspec)
*********************************************
*******************************************************
JPL Spectroscopy Queries (astroquery.linelists.jplspec)
*******************************************************

Getting Started
===============
Expand All @@ -26,7 +26,7 @@ what each setting yields:

.. doctest-remote-data::

>>> from astroquery.jplspec import JPLSpec
>>> from astroquery.linelists.jplspec import JPLSpec
>>> import astropy.units as u
>>> response = JPLSpec.query_lines(min_frequency=100 * u.GHz,
... max_frequency=1000 * u.GHz,
Expand Down Expand Up @@ -120,7 +120,7 @@ the line frequency has been measured in the laboratory
.. doctest-remote-data::

>>> import matplotlib.pyplot as plt
>>> from astroquery.jplspec import JPLSpec
>>> from astroquery.linelists.jplspec import JPLSpec
>>> result = JPLSpec.get_species_table()
>>> mol = result[result['TAG'] == 28001] #do not include signs of TAG for this
>>> print(mol)
Expand Down Expand Up @@ -210,7 +210,7 @@ to query these directly.

.. doctest-remote-data::

>>> from astroquery.jplspec import JPLSpec
>>> from astroquery.linelists.jplspec import JPLSpec
>>> import astropy.units as u
>>> result = JPLSpec.query_lines(min_frequency=100 * u.GHz,
... max_frequency=1000 * u.GHz,
Expand Down Expand Up @@ -314,7 +314,7 @@ If you are repeatedly getting failed queries, or bad/out-of-date results, try cl

.. code-block:: python

>>> from astroquery.jplspec import JPLSpec
>>> from astroquery.linelists.jplspec import JPLSpec
>>> JPLSpec.clear_cache()

If this function is unavailable, upgrade your version of astroquery.
Expand All @@ -324,5 +324,5 @@ The ``clear_cache`` function was introduced in version 0.4.7.dev8479.
Reference/API
=============

.. automodapi:: astroquery.jplspec
.. automodapi:: astroquery.linelists.jplspec
:no-inheritance-diagram:
Loading