fix: first axis should be the fast axis#974
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
20058d3 to
58956cf
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR changes scan position generation so the first user-provided axis is always the fast axis (innermost loop), aligning scan traversal with GUI/user expectations—particularly for grid-like scans. It updates both the v4 scan position generators and the legacy scan implementations, and adjusts/extends unit tests to validate the new ordering.
Changes:
- Make the first axis the fast axis for N-D raster/grid position generation (v4 + legacy).
- Update multi-region grid traversal/snaking semantics to snake the first axis within each sub-grid.
- Update existing tests and add new assertions for grid and hexagonal scans to enforce the new traversal order.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| bec_server/bec_server/scan_server/scans/position_generators.py | Updates grid/multi-region/hex position generation so axis 0 is fast; adjusts snaking semantics/documentation. |
| bec_server/bec_server/scan_server/scans/legacy_scans.py | Mirrors the fast-axis behavior change for legacy raster and hex grid generators. |
| bec_server/bec_server/scan_server/scans/multi_region_grid_scan.py | Updates docstring to match new “snake first axis” semantics. |
| bec_server/tests/tests_scan_server/test_legacy_scans.py | Updates expected legacy grid/raster traversal ordering and corresponding device set sequence. |
| bec_server/tests/tests_scan_server/scans_v4/test_position_generators.py | Updates expected multi-region grid ordering. |
| bec_server/tests/tests_scan_server/scans_v4/test_multi_region_grid_scan.py | Updates expected prepared scan positions (absolute + relative offset cases). |
| bec_server/tests/tests_scan_server/scans_v4/test_hexagonal_scan.py | Adds explicit test that the first axis is treated as fast for hex scans. |
| bec_server/tests/tests_scan_server/scans_v4/test_grid_scan.py | Adds explicit test that the first axis is treated as fast for grid scans. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
58956cf to
29bce2e
Compare
cappel89
reviewed
Jun 24, 2026
29bce2e to
55bf991
Compare
cappel89
approved these changes
Jun 24, 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.
Description
This PR fixes a bug in particular for the grid scan: The fast axis should be the first one, not the inner one.
Type of Change
How to test