Skip to content

Fix _set_cam_chunk_size: use bps.unstage/bps.stage - #29

Draft
Max Rakitin (mrakitin) wants to merge 1 commit into
mainfrom
fix/set-cam-chunk-size-unstage
Draft

Fix _set_cam_chunk_size: use bps.unstage/bps.stage#29
Max Rakitin (mrakitin) wants to merge 1 commit into
mainfrom
fix/set-cam-chunk-size-unstage

Conversation

@mrakitin

Copy link
Copy Markdown
Contributor

Replace direct detector.unstage()/detector.stage() calls with bluesky plan primitives bps.unstage()/bps.stage() so bluesky's staged-objects registry stays consistent and errors during unstage are not silently swallowed.

Why the error happened before:

  1. bps.configure triggers _current_stream_cache-based descriptor re-preparation
  2. test_scan2 must use dark → primary → background order (background stream omits motors, leaving _current_stream_cache without motors; a subsequent bps.configure would then KeyError when re-preparing the motor-inclusive 'dark' descriptor).

Need to test it at the beamline before merging.

… comments

Replace direct detector.unstage()/stage() calls with bluesky plan primitives
bps.unstage()/bps.stage() so bluesky's staged-objects registry stays consistent
and errors during unstage are not silently swallowed.

Add comments explaining why:
1. bps.configure triggers _current_stream_cache-based descriptor re-preparation
2. test_scan2 must use dark → primary → background order (background stream
   omits motors, leaving _current_stream_cache without motors; a subsequent
   bps.configure would then KeyError when re-preparing the motor-inclusive
   'dark' descriptor).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant