Skip to content

tomo_flyscan: restore the rotation stage's speed when the scan ends - #107

Merged
Jakub Wlodek (jwlodek) merged 2 commits into
NSLS2:mainfrom
sligara7:tomo-flyscan-restore-rotation-velocity
Oct 23, 2026
Merged

Jakub Wlodek (jwlodek) merged 2 commits into
NSLS2:mainfrom
sligara7:tomo-flyscan-restore-rotation-velocity

Conversation

@sligara7

@sligara7 Anthony Sligar (sligara7) commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Reported on Slack (2026-10-23): the rotation stage's speed was not reset after the tomography fly scans run on 2026-10-22.

ophyd-async's Motor.prepare sets VELO to the fly speed and nothing set it back (tomography_alignment_scan already restores it). tomo_flyscan now reads VELO before the scan and restores it in the cleanup, whether the scan succeeds or fails.

Verified with: mock tests (tests/tomography/test_flyscans.py, success and failure paths). Both failed before the fix (VELO left at 4.44 instead of 5.0). Not yet run at the beamline.

The motor's fly prepare leaves VELO at the fly speed and nothing set it back, so the stage stayed slow after every tomo fly scan (reported by Nghia Vo). Read VELO before the scan and put it back in the cleanup, however the scan ends.

Assisted-by: copilot:claude-opus-5-5
Copilot AI balanced review requested due to automatic review settings October 23, 2026 15:20

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.

🟢 Approval recommended

The focused fix uses the existing finalizer and includes regression coverage for both scan outcomes, with no unresolved findings.

No open issues 🎉

What changed in this PR

Restores the rotation stage’s original speed after tomo_flyscan, using the existing cleanup path for successful and failed scans.

Changes:

  • Captures rotation velocity before the scan and restores it during cleanup.
  • Adds mock regression tests for velocity restoration after success and failure.
File Description
tests/​tomography/​test_flyscans.py Tests velocity restoration after successful and failed scans.
src/​hextools/​tomography/​flyscans.py Saves the original rotation velocity and restores it in cleanup.

Review effort: Balanced

Comment thread src/hextools/tomography/flyscans.py Outdated
… from a closure

Review (jwlodek): follow the pattern of other plans.

Assisted-by: copilot:claude-opus-5-5
Copilot AI balanced review requested due to automatic review settings October 23, 2026 15:39

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.

🟢 Approval recommended

The focused cleanup change has regression coverage for both outcomes and no identified blocking issues; tests were not executed during this review.

No open issues 🎉

Review effort: Balanced

@jwlodek
Jakub Wlodek (jwlodek) merged commit 525421f into NSLS2:main Oct 23, 2026
6 checks passed
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