Skip to content

Slits: report blade progress with WatchableAsyncStatus - #95

Merged
Anthony Sligar (sligara7) merged 1 commit into
NSLS2:mainfrom
sligara7:hex-slits-watchable-status
Oct 7, 2026
Merged

Anthony Sligar (sligara7) merged 1 commit into
NSLS2:mainfrom
sligara7:hex-slits-watchable-status

Conversation

@sligara7

Copy link
Copy Markdown
Contributor

Slits.set, and the setters behind horizontal_gap/vertical_gap/horizontal_center/vertical_center, now use @WatchableAsyncStatus.wrap instead of @AsyncStatus.wrap, forwarding each blade motor's watcher updates with forward_watcher_updates(..., combine=False), the same pattern as DCLM.set in dclm.py. Progress bars and the hextools GUI's device-progress panel can then follow slit moves.

Behaviour is otherwise unchanged: gaps are set first (holding centers), then centers (holding gaps). Slits.set now calls the gap/center setters directly rather than through the derived signals, because a signal's set() returns a plain AsyncStatus with no watchers.

Verification: mock tests only (ophyd-async mock motors). New test_slits_set_reports_blade_progress_to_watchers failed first ('AsyncStatus' object has no attribute 'watch') and passes now; all 8 tests in tests/photon_delivery_system/test_slits.py pass; ruff check/format clean. Not yet tried on the simulated or real beamline.

Slits.set and the gap/center setters now use WatchableAsyncStatus.wrap and forward each blade motor's watcher updates (forward_watcher_updates, combine=False), as DCLM.set does, so progress bars and the GUI see slit moves.

Assisted-by: copilot:claude-opus-4-8
Copilot AI balanced review requested due to automatic review settings October 7, 2026 19:01

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 changes preserve movement calculations and sequencing, with regression coverage and no identified blocking issues.

0 open findings

What changed in this PR

Adds blade-level progress reporting to slit moves while preserving gap-first, center-second movement sequencing.

Changes:

  • Uses watchable statuses and forwards individual blade updates.
  • Calls gap and center setters directly to preserve watcher support.
  • Adds a mock test confirming progress reports from all four blades.
File Description
tests/​photon_delivery_system/​test_slits.py Tests watcher updates from all four blades.
src/​hextools/​photon_delivery_system/​slits.py Forwards blade progress through watchable slit-move statuses.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sligara7
Anthony Sligar (sligara7) merged commit 58b663f into NSLS2:main Oct 7, 2026
0 of 5 checks passed
@sligara7
Anthony Sligar (sligara7) deleted the hex-slits-watchable-status branch October 7, 2026 19:06
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