Repository navigation
fix(core): sort an Ion's out-of-order rows as its siblings do - #535
Merged
Merged
Conversation
Target tests, xfail(strict=True) until Ion sorts its data: Plasma, Spacecraft, Vector and Tensor sort rows out of time order with one warning that counts and locates them, while an Ion built directly keeps them and logs the vague 'not monotonically increasing' warning. Refs #507. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ion.set_data now puts its data in time order through _put_in_time_order_unless_checked, as Vector and Tensor do and as Plasma and Spacecraft do through _put_in_time_order: one warning counts and locates the rows out of order, and the rows are sorted. Before, an Ion built directly kept them and Base's _verify_datetimeindex logged only 'not monotonically increasing'. That warning is now reached only by an index whose values cannot be compared. An Ion built by a Plasma inherits checked times and is unchanged. Before: both target tests xfailed. With the fix and markers in place: both XPASS(strict). Markers removed: full suite 6649 passed. Closes #507. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Claude finished @blalterman's task in 25s —— View job Review of PR #535I reviewed the diff only. I did not run the tests or read the helper's source, so the points about behaviour I haven't checked are marked as such. Summary: This is a small, focused change. What looks good
Minor suggestions (non-blocking)
Risks
Overall this looks good to merge once you've considered suggestion 1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #507.
An
Ionbuilt directly from rows out of time order kept them unsorted and logged only that the index was "not monotonically increasing".Plasma,Spacecraft,VectorandTensorall sort such rows, with one warning that counts and locates them.Ion.set_datanow does the same, through the_put_in_time_order_unless_checkedhelperVectorandTensoruse. AnIonbuilt by aPlasmainherits already-checked times and is unchanged.After this,
Base._verify_datetimeindex's order warning is reached only by an index whose values cannot be compared (such as[1, "a", 2.0]), which has no order and is kept. Its docstring, and_put_in_time_order_unless_checked's, now say so.This is the last live follow-up in #507. The double warning it describes no longer occurs on master: the order decision already lives in one place,
Core._time_disorder. Its other item, the untestedSIDCLoader.download_data, is untested by design (network). The accepted mutation survivors it lists stay recorded in the issue.Tests (
2122452a, then8e9eae37)test_ion_sorts_out_of_order_rows_with_one_warning: rows given in time order 2, 0, 1 come back sorted, values attached to their times, with one warning reading "1 of 3 rows are earlier than the row before them".test_ion_warns_about_exactly_the_index_problems_presentnow expects neither of the old warnings.xfail(strict=True)and xfailed; with the fix and markers in place both were XPASS(strict); markers removed in the fix commit.🤖 Generated with Claude Code