Skip to content

Fix NAIF ID typos in Most: nafid -> naifid#3607

Open
karlhillx wants to merge 3 commits into
astropy:mainfrom
karlhillx:fix-3605-naifid-typo
Open

Fix NAIF ID typos in Most: nafid -> naifid#3607
karlhillx wants to merge 3 commits into
astropy:mainfrom
karlhillx:fix-3605-naifid-typo

Conversation

@karlhillx
Copy link
Copy Markdown

Fixes #3605.

The MOST cgi-bin API expects naifid but the astroquery code had nafid (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 message
  • get_images and query_object signatures: add obj_naifid parameter
  • get_images and query_object bodies: handle the deprecated obj_nafid keyword and "nafid_input" input_mode, remapping to the correct names with AstropyDeprecationWarning
  • qparams dict in query_object: fix the POST key from obj_nafid to obj_naifid

Tests:

  • test_naifid_input: verifies the corrected spelling actually works against the mock
  • test_nafid_deprecation: verifies the deprecated spellings emit AstropyDeprecationWarning

8/8 most tests pass. CHANGES.rst entry under ipac.irsa in 'Service fixes and enhancements'.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

❌ Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.19%. Comparing base (70dd42f) to head (f15fd12).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
astroquery/ipac/irsa/most.py 69.23% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@karlhillx karlhillx force-pushed the fix-3605-naifid-typo branch from 3400b3e to 52e7def Compare June 5, 2026 02:23
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
@karlhillx karlhillx force-pushed the fix-3605-naifid-typo branch from 52e7def to 6e2bb25 Compare June 5, 2026 02:35
@bsipocz bsipocz added this to the 0.4.12 milestone Jun 7, 2026
Copy link
Copy Markdown
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

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 thread astroquery/ipac/irsa/most.py Outdated
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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NAIF ID search in MOST does not work

2 participants