Fix NAIF ID typos in Most: nafid -> naifid#3607
Open
karlhillx wants to merge 3 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3607 +/- ##
==========================================
- Coverage 73.21% 73.19% -0.03%
==========================================
Files 226 226
Lines 21053 21040 -13
==========================================
- Hits 15414 15400 -14
- Misses 5639 5640 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3400b3e to
52e7def
Compare
Fixes astropy#3605. The MOST cgi-bin API expects 'naifid' but the astroquery code had 'nafid' (missing the 'i') in multiple places, causing NAIF ID queries to fail. Confirmed against the IRSA MOST API docs. Changes in astroquery/ipac/irsa/most.py: - _validate_nafid_input_type: fix the dict key checked and the error message - _validate_input: fix the dispatch key and the unrecognized-input error message - get_images and query_object signatures: add obj_naifid parameter, keep obj_nafid as deprecated - get_images and query_object bodies: handle the deprecated 'nafid_input' input_mode and 'obj_nafid' keyword, remapping to the correct names with AstropyDeprecationWarning - qparams dict in query_object: fix the POST key from 'obj_nafid' to 'obj_naifid' Added two tests: - test_naifid_input: verifies the corrected spelling works - test_nafid_deprecation: verifies the deprecated spellings emit AstropyDeprecationWarning
52e7def to
6e2bb25
Compare
bsipocz
requested changes
Jun 7, 2026
Member
bsipocz
left a comment
There was a problem hiding this comment.
Thanks for working on this. However the approach is not exactly correct, we have a deprecating decorator that makes this much cleaner and simpler. Could you please update the PR to use that?
Comment on lines
+332
to
+347
| # Handle deprecated parameters | ||
| if obj_nafid is not None and obj_naifid is None: | ||
| warnings.warn( | ||
| "'obj_nafid' is deprecated; use 'obj_naifid' instead (the API parameter is 'obj_naifid').", | ||
| AstropyDeprecationWarning, | ||
| stacklevel=2, | ||
| ) | ||
| obj_naifid = obj_nafid | ||
| if input_mode == "nafid_input": | ||
| warnings.warn( | ||
| "'nafid_input' is deprecated; use 'naifid_input' instead (the API value is 'naifid_input').", | ||
| AstropyDeprecationWarning, | ||
| stacklevel=2, | ||
| ) | ||
| input_mode = "naifid_input" | ||
|
|
Member
There was a problem hiding this comment.
deprecations of this kind of renaming should be done with the @deprecated_renamed_argument decorator (from astropy.utils.decorators)
See examples in the other astroquery modules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3605.
The MOST cgi-bin API expects
naifidbut the astroquery code hadnafid(missing the 'i') in multiple places, so NAIF ID queries were silently broken. Confirmed against the IRSA MOST API docs (MOSTProgramInterface.html).Changes:
_validate_nafid_input_type: fix the dict key and error message_validate_input: fix the dispatch key and the unrecognized-input error messageget_imagesandquery_objectsignatures: addobj_naifidparameterget_imagesandquery_objectbodies: handle the deprecatedobj_nafidkeyword and"nafid_input"input_mode, remapping to the correct names withAstropyDeprecationWarningqparamsdict inquery_object: fix the POST key fromobj_nafidtoobj_naifidTests:
test_naifid_input: verifies the corrected spelling actually works against the mocktest_nafid_deprecation: verifies the deprecated spellings emitAstropyDeprecationWarning8/8 most tests pass. CHANGES.rst entry under
ipac.irsain 'Service fixes and enhancements'.