Repository navigation
MAST: Read product function for MastMissions - #3593
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3593 +/- ##
==========================================
+ Coverage 73.87% 73.94% +0.06%
==========================================
Files 228 228
Lines 21485 21572 +87
==========================================
+ Hits 15873 15952 +79
- Misses 5612 5620 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Until we have a more mature version ready, can we please ensure documentation / tutorials call out that for FITS files I presume this can be avoided once there's a "get_s3_uris()" endpoint in MissionMAST for all the supported missions beyond Roman? |
617201a to
cdda4a2
Compare
7808985 to
e1ea60e
Compare
e1ea60e to
a5214b2
Compare
bsipocz
left a comment
There was a problem hiding this comment.
code changes look good, but I have problem with the proposed changes in pyproject.toml, IMO we should avoid workaround for [all] and should not include optional dependencies to be installed for all the test jobs.
| "sphinx-astropy>=1.5", | ||
| "scipy", | ||
| "fsspec[http]", | ||
| "asdf" |
There was a problem hiding this comment.
I think I thought I had to include it for the code blocks. Removed!
| "fsspec[http]", | ||
| "fsspec[http,s3]", | ||
| "moto[s3]", | ||
| "s3fs", | ||
| "asdf" |
There was a problem hiding this comment.
I don't think that optional dependencies should be installed for all test runs. The fact that we have fsspec and s3fs listed here is a problem of its own and should be cleaned up. So, I would not think we should add asdf.
9eae055 to
2a83677
Compare
2a83677 to
4e9dd36
Compare
4e9dd36 to
bcd4eb8
Compare
f071d04 to
d620a7a
Compare
d620a7a to
f051f27
Compare
|
Could we get another round of review on this PR? After the weekend, of course. We're hoping to get this particular feature into a dev release as soon as we can since it will be important for accessing Roman data. |
3a4c60f to
badbbcc
Compare
badbbcc to
437b9e2
Compare
bsipocz
left a comment
There was a problem hiding this comment.
Here are some comments, I don't see any big issues but am still waiting on the tests to finish
| if asdf is not None: | ||
| mock_asdf_file = MagicMock(spec=asdf.AsdfFile) | ||
| else: | ||
| mock_asdf_file = MagicMock() |
There was a problem hiding this comment.
I'm not sure what this suppose to be, what is the scenario when you end up in the else part? (if there is no asdf then we should not get to that line)
| assert isinstance(obj, fits.HDUList) | ||
|
|
||
|
|
||
| def test_missions_read_product_asdf(mocker, mock_asdf_open): |
There was a problem hiding this comment.
do we want to instead decorate these with a skipif like we do for other optional dependencies?
|
|
||
| return manifest | ||
|
|
||
| def read_product(self, uri, *, mission=None, **kwargs): |
There was a problem hiding this comment.
in other modules we tend to have the naming of get_... rather than read_..., but I can't claim we are overly consistent, and that what we have is the way should be. But, eventually we may want to be more unified. And we already have get_product etc in euclid that downloads data.
There was a problem hiding this comment.
We chatted about this: renaming and adding a deprecation warning for the rename from read_product sounds good to me.
| **file_kwargs, | ||
| ) | ||
| except ImportError: | ||
| fsspec = None |
There was a problem hiding this comment.
Minor nitpicking about consistency, we tend to use the HAS_{packagename} variables for cases like this.
A function in the
MastMissionsclass that can read products into memory.For FITS files, we use
astropy.io.fits.open. The product files are downloaded and cached by Astropy, and then read into aHDUListobject.For ASDF files, we use
fsspecandasdf. Our downloads for Roman data are redirected to S3, so these files are not downloaded and are streamed directly intoasdf.AsdfFileobjects.