Skip to content

Commit 1f445f6

Browse files
committed
Updating deprecation message, uses warnings package and adding unused kwarg to decorator
1 parent 9ffcee7 commit 1f445f6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

astroquery/astrometry_net/core.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33

44
import json
5+
import warnings
56

67
from astropy.io import fits
78
from astropy.stats import sigma_clipped_stats
89
from astropy.coordinates import SkyCoord
9-
from astropy.utils.decorators import deprecated_renamed_argument
10+
from astropy.utils.decorators import AstropyDeprecationWarning, deprecated_renamed_argument
1011

1112
try:
1213
from astropy.nddata import CCDData
@@ -332,7 +333,7 @@ def solve_from_source_list(self, x, y, image_width, image_height, *,
332333
verbose=verbose,
333334
return_submission_id=return_submission_id)
334335

335-
@deprecated_renamed_argument("force_image_upload", None, since="0.4.8")
336+
@deprecated_renamed_argument(("force_image_upload", "ra_dec_units"), (None, None), since="0.4.8")
336337
def solve_from_image(self, image_file_path, *, force_image_upload=False,
337338
ra_key=None, dec_key=None,
338339
ra_dec_units=None,
@@ -414,10 +415,11 @@ def solve_from_image(self, image_file_path, *, force_image_upload=False,
414415
cache=False,
415416
files={'file': f})
416417
else:
417-
warning_msg = "Removing photutils functionality to obtain position list." \
418-
"Users can generate a coordinate list and upload to Astrometry.net" \
419-
"or a fits file that Astrometry.net will extract positions."
420-
DeprecationWarning(warning_msg)
418+
warning_msg = "Removing photutils functionality to obtain extracted positions list from " \
419+
"AstoromertyNetClass.solve_from_source_list. Users will need to " \
420+
"submit pre-extracted catalog positions or a fits file for https://nova.astrometry.net/ " \
421+
"to extract with their algorithm."
422+
warnings.warn(warning_msg, category=AstropyDeprecationWarning)
421423
# Detect sources and delegate to solve_from_source_list
422424
if _HAVE_CCDDATA:
423425
# CCDData requires a unit, so provide one. It has absolutely

0 commit comments

Comments
 (0)