DM-54841: Fix bug in CubeComponent.to_component#25
Merged
Conversation
`ScarletCubeComponentData.to_component` was constructing the returned `CubeComponent`'s peak as `(peak[0], peak[0])` instead of `(peak[0], peak[1])`, so any non-symmetric peak silently round-tripped through persistence with the x coordinate replaced by the y coordinate. Fix by using `peak[1]` for the second axis. Adds `test_cube_component_to_component_preserves_peak` asserting that a (y, x) = (54, 105) peak survives `to_component` intact; the test fails against the buggy code with `(54, 54) != (54, 105)`. Pair coded with @fred3m. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25 +/- ##
=======================================
Coverage 93.34% 93.35%
=======================================
Files 49 49
Lines 6386 6393 +7
=======================================
+ Hits 5961 5968 +7
Misses 425 425 ☔ View full report in Codecov by Sentry. |
natelust
approved these changes
Jun 4, 2026
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.
ScarletCubeComponentData.to_componentwas constructing the returnedCubeComponent's peak as(peak[0], peak[0])instead of(peak[0], peak[1]), so any non-symmetric peak silently round-tripped through persistence with the x coordinate replaced by the y coordinate. Fix by usingpeak[1]for the second axis.Checklist