-
Notifications
You must be signed in to change notification settings - Fork 166
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
SearchResult no longer ordered chronologically, it could break user expectation #1384
Comments
@christinahedges The sort order change was slipped in in PR #1380 . I wonder if the change could break other people's codes (in addition to mine). My actual use case is to download the lightcurves of a given TIC for all observation time, with the best available product/author for each sector (use case in #1048). The change makes the resulting |
I'm experiencing the same and it is breaking my code too. |
@orionlee so MAST uploaded a few new HLSPs that broke other stuff in lightkurve and this was my attempt at fixing it. I'm working on 2.5.0dev right now with a much better fix. Let me take a crack at finishing this up and let's chat on that PR about what to do with v2.4.2 and find the best solution |
christinahedges: I have subscribed to PR #1383 for the new new HLSPs. Ping me when you're ready. In the meantime, I use a helper to resort the SearchResult chronologically in my codes. import lightkurve as lk
def _sort_chronologically(sr: lk.SearchResult):
res = lk.SearchResult(sr.table.copy())
res.table.sort(["distance", "year", "mission", "sort_order", "exptime"])
return res |
Issue:
The new sort order in
v2.4.2
could break some user expectation.In just released
v2.4.2
, the SearchResult sort order is changed to give priority ofauthor
(implicitly viasort_order
), over the observation time (implicitly viamission
as it contains sector/quarter/campaign).lightkurve/src/lightkurve/search.py
Lines 137 to 141 in 7a7dc2a
The old sort order for reference:
Example
In the use case that an user wants to download all lightcurves of a given TIC, and use the best available product for each sector (see #1048).
I used to be able to get a SearchResult, ordered by observation time (via mission).
With
v.2.4.2
, the SearchResult is first ordered by author.As a result, the
LightCurveCollection
obtained fromSearchResult.download_all()
is not ordered chronologically either.version: v2.4.2
The text was updated successfully, but these errors were encountered: