Skip to content

Allow multiple search positions in MastMissions#3540

Merged
bsipocz merged 4 commits intoastropy:mainfrom
snbianco:multiple-targets
Mar 12, 2026
Merged

Allow multiple search positions in MastMissions#3540
bsipocz merged 4 commits intoastropy:mainfrom
snbianco:multiple-targets

Conversation

@snbianco
Copy link
Copy Markdown
Contributor

@snbianco snbianco commented Feb 26, 2026

MastMissions query functions now support single or multiple targets via coordinates and
object_names (including combined use in query_criteria).

Notes:

  • Multiple coordinates/object names can be provided as an iterable or a comma-separated string.
  • The legacy objectname keyword is deprecated in favor of object_names.
  • query_criteria no longer requires that a non-positional criterion be provided.
  • Refactored so that query_region and query_object call query_criteria. Docs now emphasize that query_region and query_object are convenience wrappers.

@snbianco snbianco added the mast label Feb 26, 2026
@snbianco snbianco requested a review from bsipocz February 26, 2026 21:43
fix docs build

Add PR number to changelog

Remove unnecessary reference to objectname
@snbianco snbianco marked this pull request as ready for review February 26, 2026 22:03
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.76%. Comparing base (f1489ea) to head (b50cfc8).
⚠️ Report is 37 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3540      +/-   ##
==========================================
+ Coverage   72.66%   72.76%   +0.10%     
==========================================
  Files         219      219              
  Lines       20478    20543      +65     
==========================================
+ Hits        14880    14948      +68     
+ Misses       5598     5595       -3     

☔ View full report in Codecov by Sentry.
📢 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.

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.

Some comments, the documentation example needs to be fixed otherwise it looks good.

Thanks!

assert result == ['10.684 41.269']

# List of coordinate objects
coords = [SkyCoord(10.684, 41.269, unit='deg'), SkyCoord(83.6331, 22.0145, unit='deg')]
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.

I suppose this would also work with a vector SkyCoord as opposed to a list of singletons?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It does not! Good catch. I'll make that change.

210.80227 54.34895 OBQU010F0 NUCLEUS+HODGE602 2012-05-24T09:09:18.570000 2012-05-24T09:12:24.570000 0.022143836477276503 PUBLIC
210.80227 54.34895 OBQU01070 NUCLEUS+HODGE602 2012-05-24T08:00:00.553000 2012-05-24T08:03:06.553000 0.04381046755938432 PUBLIC
>>> select_cols = ["sci_targname", "sci_pep_id", "sci_status"]
>>> results = missions.query_criteria(coordinates=[SkyCoord(245.89675, -26.52575, unit='deg'), "205.54842 28.37728"],
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.

This example errors out when remote tests are run, could you please have a look at it?


@class_or_instance
def query_criteria_async(self, *, coordinates=None, objectname=None, radius=3*u.arcmin,
@deprecated_renamed_argument('objectname', 'object_names', since='0.4.11')
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.

there are a couple more of these objectname kwargs, would you mind changing them to the snake case, too? (not in this PR, but sometime, for the sake of API consistency)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is in our plans! Catalogs will change with the new version, and I can make another PR for Observations and Cutouts.

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.

Thank you, this all looks good now!

@bsipocz bsipocz merged commit 2238787 into astropy:main Mar 12, 2026
11 checks passed
@bsipocz bsipocz added this to the 0.4.12 milestone Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants