Skip to content

ASB-30568: Adding read_product Function to load files from s3 to memory#3561

Open
AlexReedy wants to merge 28 commits intoastropy:mainfrom
AlexReedy:ASB-30568_read-product-function
Open

ASB-30568: Adding read_product Function to load files from s3 to memory#3561
AlexReedy wants to merge 28 commits intoastropy:mainfrom
AlexReedy:ASB-30568_read-product-function

Conversation

@AlexReedy
Copy link
Copy Markdown

@AlexReedy AlexReedy commented Mar 20, 2026

Adding in ability to read FITS and ASDF data products to memory from s3:// using Observations.read_product() function

@bsipocz bsipocz added the mast label Apr 4, 2026
@snbianco snbianco self-requested a review April 9, 2026 14:53
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 24.32432% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.14%. Comparing base (a1fee2a) to head (8dd81d2).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
astroquery/mast/observations.py 24.32% 28 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3561      +/-   ##
==========================================
- Coverage   73.22%   73.14%   -0.09%     
==========================================
  Files         226      226              
  Lines       21000    21037      +37     
==========================================
+ Hits        15378    15387       +9     
- Misses       5622     5650      +28     

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

@AlexReedy AlexReedy marked this pull request as ready for review April 17, 2026 16:57
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.

The commit history is a bit all over the place. Could you please clean it up and squash to logical chucks rather than quasi random back and forth? Thanks!

I suppose this will also need narrative documentation; but I'll leave the more detailed review to @snbianco

Comment thread astroquery/mast/observations.py Outdated
except Exception as e:
log.exception(f"Failed to open ASD File: {product_path} {e}")
else:
print("Unsupported extension type")
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.

please don't print anything; either raise proper warning or error classes or put this behind a verbose option.

Copy link
Copy Markdown
Author

@AlexReedy AlexReedy Apr 20, 2026

Choose a reason for hiding this comment

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

ah thank you! I thought I got rid of all of those

'`~astroquery.mast.ObservationsClass.enable_cloud_dataset` method.'
)

asdf_packages = ["asdf", "s3fs", "fsspec", "lz4", "gwcs"]
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.

does all of these really need to be checked here even as they are not directly been used? If asdf requires the whole list then these checks should be dealt with upstream in asdf itself.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This has been an ongoing question with the implementation. Required would be asdf, s3fs, fsspec for the function to work. for asdf specifically, lz4 seems to be the primary compression algorithm being used for asdf and gwcs is for the general.

I know that gwcs is in their test environment, and they also make calls to lz4 but I don't believe it's included when it's installed. I agree it should probably be upstream in asdf.

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