Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download Products with MastMissions #3155

Merged
merged 7 commits into from
Jan 24, 2025

Conversation

snbianco
Copy link
Contributor

@snbianco snbianco commented Dec 18, 2024

This MR adds methods to MastMissions that allow users to retrieve and download products from the Missions-MAST API.

  • Retrieve products for datasets with get_product_list
  • Retrieve only unique products with get_unique_product_list
  • Filter products based on extension and other properties with filter_products
  • Download products with download_products
  • Download a single product with download_file

A few notes:

  • Added a setter for the mission property so that users can use the same MastMissions object to query multiple missions.
  • Although not ideal, some values are hard-coded in (dataset_kwds and _default_ullyses_cols, for example). These are due to limitations in the API, and I've reported these problems internally at MAST.
  • Added the missions_request_async function to services.py to handle API requests coming from MastMissions.

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 88.77005% with 21 lines in your changes missing coverage. Please review.

Project coverage is 67.75%. Comparing base (0bed33f) to head (aab812a).
Report is 49 commits behind head on main.

Files with missing lines Patch % Lines
astroquery/mast/missions.py 90.13% 15 Missing ⚠️
astroquery/mast/services.py 86.36% 3 Missing ⚠️
astroquery/mast/observations.py 50.00% 2 Missing ⚠️
astroquery/mast/utils.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3155      +/-   ##
==========================================
+ Coverage   67.57%   67.75%   +0.17%     
==========================================
  Files         229      229              
  Lines       18593    18733     +140     
==========================================
+ Hits        12565    12692     +127     
- Misses       6028     6041      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@snbianco
Copy link
Contributor Author

Tagging @astrojimig and @dr-rodriguez for visibility

@snbianco snbianco marked this pull request as ready for review December 19, 2024 00:28
@snbianco snbianco requested a review from bsipocz December 19, 2024 00:35
@snbianco snbianco added the mast label Dec 19, 2024
@bsipocz bsipocz added this to the v0.4.8 milestone Dec 19, 2024
@bsipocz bsipocz modified the milestones: v0.4.8, v0.4.9 Jan 14, 2025
@snbianco
Copy link
Contributor Author

Pinging this MR again just in case it got lost in the shuffle of the holidays and/or AAS.

@snbianco snbianco force-pushed the ASB-29334-download-missions branch from ac7f334 to aab812a Compare January 23, 2025 17:57
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.

Thanks. Overall this looks good.

I noticed there are a couple of test failures and errors, but all of the look unrelated to this PR, so I go ahead with the merge now. If you could look into them and open a PR with a fix, it would be great.

# Return filtered products
return products[filter_mask]

def download_file(self, uri, *, local_path=None, cache=True, verbose=True):
Copy link
Member

Choose a reason for hiding this comment

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

we'll need to unify all these download fuctionalities between the different modules. So it's more like a heads up, that something will come in place as a utility either in astroquery or in pyvo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the heads up! I put the test fixes into #3164.

@bsipocz bsipocz merged commit 5a9633c into astropy:main Jan 24, 2025
11 checks passed
@bsipocz
Copy link
Member

bsipocz commented Jan 24, 2025

Thanks!

@snbianco
Copy link
Contributor Author

snbianco commented Jan 24, 2025

Was this supposed to be in the newest release? The release was made after this was merged, but it doesn't seem like this merge is in the included commits.

@bsipocz
Copy link
Member

bsipocz commented Jan 24, 2025

It should be in it but I may have messed up the cherry picking. (It was a one off quick release to fix some regression, so not everything got included)

bsipocz added a commit that referenced this pull request Jan 25, 2025
@bsipocz
Copy link
Member

bsipocz commented Jan 25, 2025

I ended up doing a 0.4.9.post1 release as I used the same errenous cherry-pick command for multiple PRs.

A normal pip install -U astroquery should pick up this version.

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