You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
XRD plans for the Perkin Elmer and plan tabs in the GUI XRD view - #110
Adds xrd_count, xrd_scan and xrd_dark (thin wrappers over take_radiograph / bp.scan) and gives the GUI XRD tab Count / Scan / Dark / Calibration plan tabs, like the EDXD tab. ensure_cont_acq_exposure restarts the continuous-acquisition Perkin Elmer at the requested exposure, as the pyepics scripts did. Plans are exported from hextools.xrd and imported into the profile.
First step of converting hex-acq-pyepics/techniques/xrd; the Pilatus comes in a follow-up.
Verified: mock tests only (mocked Perkin Elmer ContAcqDetector, shutters, SimMotor) plus an offscreen GUI test; 403 non-GUI + 49 GUI tests pass, ruff/ty clean. Not yet run on the beamline.
…n tabs in the GUI XRD view
Thin wrappers over take_radiograph and bp.scan. ensure_cont_acq_exposure restarts the continuous-acquisition Perkin Elmer at the requested exposure, as the pyepics scripts did. The XRD tab gets Count / Scan / Dark / Calibration plan tabs, like the EDXD tab.
Assisted-by: copilot:claude-opus-5-5
ensure_cont_acq_exposure started the busy Acquire record with abs_set(wait=False), so prepare could read Acquire before it updated, and prepare(wait=True) waited on the never-finishing put (group None). It now waits for the readback with set_and_wait_for_value(wait_for_set_completion=False). xrd_calibration passed six arguments to abs_set (TypeError); it now uses ensure_cont_acq_exposure for a continuous-acquisition detector and bps.mv otherwise. Both observed failing first in the new tests.
Assisted-by: copilot:claude-opus-5-5
xrd_count set the Perkin Elmer's exposure before take_radiograph's shutter-closing cleanup was in place, so a setup failure with the shutter already open left the beam on; xrd_calibration did the same before its try. Both now run setup inside a cleanup that closes the photon shutter, and xrd_calibration returns the motor even if the shutter fails to close. Found by Copilot review on NSLS2#110.
Assisted-by: copilot:claude-opus-5-5
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
A shutter-close failure in xrd_scan prevents the requested motor reset.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Ensure motor reset runs when photon shutter closure fails
src/hextools/xrd/plans.py:310
If closing the photon shutter raises (for example, when it is stuck open), cleanup exits before attempting the motor reset, even with reset_position=True. This leaves the motor at the last scan point. Wrap shutter closure in try/finally so the reset is still attempted, as xrd_calibration now does, and add a regression test for this failure path.
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
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.
Adds
xrd_count,xrd_scanandxrd_dark(thin wrappers overtake_radiograph/bp.scan) and gives the GUI XRD tab Count / Scan / Dark / Calibration plan tabs, like the EDXD tab.ensure_cont_acq_exposurerestarts the continuous-acquisition Perkin Elmer at the requested exposure, as the pyepics scripts did. Plans are exported fromhextools.xrdand imported into the profile.First step of converting
hex-acq-pyepics/techniques/xrd; the Pilatus comes in a follow-up.Verified: mock tests only (mocked Perkin Elmer
ContAcqDetector, shutters,SimMotor) plus an offscreen GUI test; 403 non-GUI + 49 GUI tests pass, ruff/ty clean. Not yet run on the beamline.