Skip to content

Commit ce13575

Browse files
committed
Adding deprecations and testing for the old namespaces
1 parent f4cce72 commit ce13575

File tree

7 files changed

+44
-1
lines changed

7 files changed

+44
-1
lines changed

astroquery/ibe/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2+
3+
4+
import warnings
5+
6+
warnings.warn("the ``ibe`` module has been moved to astroquery.ipac.irsa.ibe, "
7+
"please update your imports.", DeprecationWarning, stacklevel=2)
8+
9+
from astroquery.ipac.irsa.ibe import *

astroquery/ipac/irsa/ibe/tests/test_ibe.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,8 @@ def test_ibe_field_id(patch_get):
9494
where="ptffield = 4808 and filter='R'")
9595
assert isinstance(table, Table)
9696
assert len(table) == 22
97+
98+
99+
def test_deprecated_namespace_import_warning():
100+
with pytest.warns(DeprecationWarning):
101+
import astroquery.ibe

astroquery/ipac/irsa/irsa_dust/tests/test_irsa_dust.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,3 +374,8 @@ def set_ext_image_text(self, text, xml_tree):
374374
image_node = results_node.find("./data/image")
375375
image_url = text
376376
image_node.text = image_url
377+
378+
379+
def test_deprecated_namespace_import_warning():
380+
with pytest.warns(DeprecationWarning):
381+
import astroquery.irsa_dust

astroquery/ipac/irsa/sha/tests/test_sha.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,8 @@ def test_get_file(patch_get):
7575
# sha.save_file(table_url)
7676
# sha.save_file(image_url)
7777
img = sha.get_file(image_url)
78+
79+
80+
def test_deprecated_namespace_import_warning():
81+
with pytest.warns(DeprecationWarning):
82+
import astroquery.sha

astroquery/irsa_dust/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2+
3+
4+
import warnings
5+
6+
warnings.warn("the ``irsa_dust`` module has been moved to "
7+
"astroquery.ipac.irsa.irsa_dust, "
8+
"please update your imports.", DeprecationWarning, stacklevel=2)
9+
10+
from astroquery.ipac.irsa.irsa_dust import *

astroquery/sha/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2+
3+
4+
import warnings
5+
6+
warnings.warn("the ``sha`` module has been moved to astroquery.ipac.irsa.sha, "
7+
"please update your imports.", DeprecationWarning, stacklevel=2)
8+
9+
from astroquery.ipac.irsa.sha import *

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ show-response = 1
2626

2727
[tool:pytest]
2828
minversion = 6.0
29-
norecursedirs = build docs/_build docs/gallery-examples astroquery/irsa astroquery/nasa_exoplanet_archive astroquery/ned
29+
norecursedirs = build docs/_build docs/gallery-examples astroquery/irsa astroquery/nasa_exoplanet_archive astroquery/ned astroquery/ibe astroquery/irsa_dust astroquery/sha
3030
doctest_plus = enabled
3131
astropy_header = true
3232
text_file_format = rst

0 commit comments

Comments
 (0)