Use lightkurve's cache instead of maintaining our own #230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Instead of trying to maintain our own caching system, why not just rely on lightkurve? This simplifies
query_lightkurve
to just go ahead and uselightkurve
to retrieve the data, rather than going throughlaunch_query
andlookup_cached_files
to see if its in the cache manually. If we want to be aggressive with this PR,launch_query
andlookup_cached_files
can be removed as they aren't called anywhere else (I don't think).The downside with lightkurve's caching is that, as far as I can tell, there's no simple option for bypassing the cache and forcing data to be downloaded again. But it can be done manually (by deleting the relevant cached files) and someone can open an issue against lightkurve or open a PR to implement it if they like.
I tried to preserve the
ValueError
that was produced if no data is found. Happy to tweak this if you send me some examples I should check.