add generator version of mast.Observations.download_products#3475
add generator version of mast.Observations.download_products#3475eteq wants to merge 1 commit intoastropy:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3475 +/- ##
==========================================
- Coverage 71.48% 71.41% -0.07%
==========================================
Files 234 234
Lines 20096 20121 +25
==========================================
+ Hits 14365 14369 +4
- Misses 5731 5752 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hey Eric, thanks for this PR! I do think this is worth doing as it provides more powers to users without breaking the API. Users often want to download a ton of data from us, and this solves a real unmet need that we have. Since so much of |
I'm not sure about the proposed API though, MAST is already such an odd ball out and this just makes it even more complicated. We still working on removing function duplicates that are doing almost the same, and thus I would be careful recreating the same problem down the line for the download functions. |
The main purpose of this PR is to add
download_products_itermethod tomast.Observations. My motivation here is to allow something like the following:which then allows downloading a large number of files with both a progress bar and some custom progress reporting. Of course,
verbose=Truedoes something akin to this, but I find sometimes for large downloads I want more control of the progress reporting.This is a draft at this stage, with no tests or doc updates because I figured it was better to do that before doing all the rest of the work in case this has been considered and rejected in the past. There might also be cleaner ways to split up the generator and the non-generator version, but this seemed the most low-impact way in case the private method is used in the wild elsewhere.
cc @snbianco I think is the right person?