Skip to content

fix: first axis should be the fast axis#974

Merged
wakonig merged 1 commit into
mainfrom
fix/first_fast_axis
Jun 24, 2026
Merged

fix: first axis should be the fast axis#974
wakonig merged 1 commit into
mainfrom
fix/first_fast_axis

Conversation

@wakonig

@wakonig wakonig commented Jun 23, 2026

Copy link
Copy Markdown
Member

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

  • Make the first axis always the fast one. This is much easier to communicate and easier to understand when using the GUI.

How to test

  • Run unit tests
  • Plot the positions with BW

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@wakonig wakonig force-pushed the fix/first_fast_axis branch from 20058d3 to 58956cf Compare June 23, 2026 14:46
@wakonig wakonig marked this pull request as ready for review June 23, 2026 14:54
Copilot AI review requested due to automatic review settings June 23, 2026 14:54
@wakonig wakonig self-assigned this Jun 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread bec_server/bec_server/scan_server/scans/position_generators.py Outdated
Comment thread bec_server/bec_server/scan_server/scans/legacy_scans.py Outdated
@wakonig wakonig force-pushed the fix/first_fast_axis branch from 58956cf to 29bce2e Compare June 24, 2026 06:43
@wakonig wakonig requested a review from a team June 24, 2026 06:44
Comment thread bec_server/bec_server/scan_server/scans/position_generators.py
@wakonig wakonig force-pushed the fix/first_fast_axis branch from 29bce2e to 55bf991 Compare June 24, 2026 09:25
@wakonig wakonig merged commit e3c3e52 into main Jun 24, 2026
37 checks passed
@wakonig wakonig deleted the fix/first_fast_axis branch June 24, 2026 12:02
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.

3 participants