Skip to content

Commit ceb6c1a

Browse files
authored
Merge pull request #3455 from keflavich/move_jplspec
2 parents 7a8db78 + 8140eb7 commit ceb6c1a

File tree

18 files changed

+81
-42
lines changed

18 files changed

+81
-42
lines changed

CHANGES.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ mast
3333
- Expand the supported data types for filter values in ``Mast.mast_query``. Previously, users had to input
3434
filter values enclosed in lists, even when specifying a single value or dictionary. [#3422]
3535

36+
jplspec
37+
^^^^^^^
38+
39+
- Moved to linelists/. astroquery.jplspec is now deprecated in favor of astroquery.linelists.jplspec [#3455]
40+
41+
linelists.jplspec
42+
^^^^^^^^^^^^^^^^^
43+
44+
- New location for jplspec. astroquery.jplspec is now deprecated in favor of astroquery.linelists.jplspec [#3455]
45+
3646

3747
Infrastructure, Utility and Other Changes and Additions
3848
-------------------------------------------------------

astroquery/jplspec/__init__.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
22
"""
3-
JPL Spectral Catalog
4-
--------------------
3+
JPL Spectral Catalog (Deprecated Location)
4+
-------------------------------------------
55
6+
.. deprecated:: 0.4.12
7+
The `astroquery.jplspec` module has been moved to `astroquery.linelists.jplspec`.
8+
Please update your imports to use `from astroquery.linelists.jplspec import JPLSpec` instead.
9+
This backward compatibility layer will be removed in a future version.
610
7-
:author: Giannina Guzman (gguzman2@villanova.edu)
8-
:author: Miguel de Val-Borro (miguel.deval@gmail.com)
9-
10-
"""
11-
from astropy import config as _config
11+
This module provides backward compatibility for the old import location.
12+
The JPLSpec module has been reorganized under the linelists subpackage.
1213
14+
For new code, please use::
1315
14-
class Conf(_config.ConfigNamespace):
15-
"""
16-
Configuration parameters for `astroquery.jplspec`.
17-
"""
18-
server = _config.ConfigItem(
19-
'https://spec.jpl.nasa.gov/cgi-bin/catform',
20-
'JPL Spectral Catalog URL.')
21-
22-
timeout = _config.ConfigItem(
23-
60,
24-
'Time limit for connecting to JPL server.')
16+
from astroquery.linelists.jplspec import JPLSpec
2517
18+
"""
19+
import warnings
2620

27-
conf = Conf()
21+
# Issue deprecation warning
22+
warnings.warn(
23+
"Importing from 'astroquery.jplspec' is deprecated. "
24+
"Please use 'from astroquery.linelists.jplspec import JPLSpec' instead. "
25+
"The old import path will be removed in a future version.",
26+
DeprecationWarning,
27+
stacklevel=2
28+
)
2829

29-
from .core import JPLSpec, JPLSpecClass
30+
# Import from the new location
31+
from ..linelists.jplspec import JPLSpec, JPLSpecClass, Conf, conf
3032

31-
__all__ = ['JPLSpec', 'JPLSpecClass',
32-
'Conf', 'conf',
33-
]
33+
__all__ = ['JPLSpec', 'JPLSpecClass', 'Conf', 'conf']
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2+
"""
3+
JPL Spectral Catalog
4+
--------------------
5+
"""
6+
from astropy import config as _config
7+
8+
9+
class Conf(_config.ConfigNamespace):
10+
"""
11+
Configuration parameters for `astroquery.linelists.jplspec`.
12+
"""
13+
server = _config.ConfigItem(
14+
'https://spec.jpl.nasa.gov/cgi-bin/catform',
15+
'JPL Spectral Catalog URL.')
16+
17+
timeout = _config.ConfigItem(
18+
60,
19+
'Time limit for connecting to JPL server.')
20+
21+
22+
conf = Conf()
23+
24+
from .core import JPLSpec, JPLSpecClass
25+
26+
__all__ = ['JPLSpec', 'JPLSpecClass',
27+
'Conf', 'conf',
28+
]

astroquery/jplspec/core.py renamed to astroquery/linelists/jplspec/core.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44

55
import astropy.units as u
66
from astropy.io import ascii
7-
from ..query import BaseQuery
8-
from ..utils import async_to_sync
7+
from astroquery.query import BaseQuery
8+
from astroquery.utils import async_to_sync
99
# import configurable items declared in __init__.py
10-
from . import conf
11-
from . import lookup_table
10+
from astroquery.linelists.jplspec import conf, lookup_table
1211
from astroquery.exceptions import EmptyResponseError, InvalidQueryError
1312

1413

File renamed without changes.
File renamed without changes.

astroquery/jplspec/setup_package.py renamed to astroquery/linelists/jplspec/setup_package.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ def get_package_data():
1111
os.path.join('data', 'multi.data')]
1212
paths_data = [os.path.join('data', 'catdir.cat')]
1313

14-
return {'astroquery.jplspec.tests': paths_test,
15-
'astroquery.jplspec': paths_data, }
14+
return {'astroquery.linelists.jplspec.tests': paths_test,
15+
'astroquery.linelists.jplspec': paths_data, }

0 commit comments

Comments
 (0)