Skip to content

DM-54841: Fix bug in CubeComponent.to_component#25

Merged
fred3m merged 1 commit into
mainfrom
tickets/DM-54841
Jun 4, 2026
Merged

DM-54841: Fix bug in CubeComponent.to_component#25
fred3m merged 1 commit into
mainfrom
tickets/DM-54841

Conversation

@fred3m

@fred3m fred3m commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

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.

Checklist

  • ran Jenkins

`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

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.35%. Comparing base (ab7f39b) to head (114bce8).
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

@fred3m fred3m merged commit 0b195f5 into main Jun 4, 2026
18 checks passed
@fred3m fred3m deleted the tickets/DM-54841 branch June 4, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants