Skip to content

Allow multiple search positions in MastMissions#3540

Open
snbianco wants to merge 3 commits intoastropy:mainfrom
snbianco:multiple-targets
Open

Allow multiple search positions in MastMissions#3540
snbianco wants to merge 3 commits intoastropy:mainfrom
snbianco:multiple-targets

Conversation

@snbianco
Copy link
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

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.69%. Comparing base (20487dc) to head (f40a1a5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3540      +/-   ##
==========================================
+ Coverage   72.66%   72.69%   +0.02%     
==========================================
  Files         219      219              
  Lines       20478    20499      +21     
==========================================
+ Hits        14880    14901      +21     
  Misses       5598     5598              

☔ 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
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
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?

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
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
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)

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