Skip to content

Fixes for #90: beam-mode NameError, suspender guard, CI collection, alignment tests - #3

Closed
sligara7 wants to merge 4 commits into
jwlodek:hex-tuned-queue-monitorfrom
sligara7:pr90-fixes
Closed

sligara7 wants to merge 4 commits into
jwlodek:hex-tuned-queue-monitorfrom
sligara7:pr90-fixes

Conversation

@sligara7

@sligara7 sligara7 commented Oct 5, 2026

Copy link
Copy Markdown

Fixes for NSLS2#90, as a PR into this branch so they land in NSLS2#90 before it merges to main. One commit per issue:

  • dclm: import forward_watcher_updates — DCLM.set called it without importing it, so every white/mono beam-mode change (and the new change_beam_mode plan) raised NameError. Both test_monochromator_beam_mode_switch cases failed.
  • Profile: restore the ops-mode guard on the beam-current suspender — the merge with main replaced the guard from a8feb5c with an unconditional SuspendFloor(beam_current, 100, resume_thresh=390). That would pause plans during MAINTENANCE/SHUTDOWN until the ring is above 390 mA. Restored main's version unchanged.
  • pytest: don't collect src/hextools/gui — --doctest-modules imported the GUI modules in CI, where qtpy and bluesky-widgets aren't installed: 13 collection errors on Python 3.11–3.13.
  • Tests: call tomo_alignment_scan with its new keyword arguments — the shutters and rotation motor became optional keyword arguments after exposure_time, but the tests still passed them positionally.

How this was verified

Mock tests only (ophyd-async mock devices; no simulated beamline, TST or real beamline). Same environment for both runs: hextools py312 pixi env, pytest -q, run the way CI runs it.

failed passed errors
main (0bc0fe2) 13 115 0
NSLS2#90 head (6a9e06e) 15 112 1 + 13 GUI collection errors in CI
this branch 13 115 0

The 13 remaining failures are the same tests that fail on main (GeRM, Phantom, change_energy, tomography alignment, radiograph). The alignment tests now fail only on main's existing ValueError: True is not a valid ShutterStatus, not on the call signature. The suspender guard is in the profile, which pytest doesn't collect, so it has no automated test here.

Not in this PR

  • RE_METADATA_KEYS is undefined in gui/__main__.py:195. It's inside QtRunEngineManagerMonitor, which nothing instantiates, so it doesn't crash; define it or drop the class.
  • Type check and lint will stay red: the type checker can't resolve the Qt/bluesky-widgets imports without the gui extra, and lint debt exists in files this PR doesn't touch.
  • Design points for discussion are in a comment on Acquisition GUI based on queue-monitor, that also allows for running locally. NSLS2/hextools#90.

DCLM.set called forward_watcher_updates without importing it, so every beam-mode change raised NameError (both test_monochromator_beam_mode_switch cases failed).

Assisted-by: copilot:claude-opus-4-8
The merge with main replaced a8feb5c's guard with an unconditional SuspendFloor, which would pause plans during MAINTENANCE/SHUTDOWN until the ring is above 390 mA. Restored main's version.

Assisted-by: copilot:claude-opus-4-8
--doctest-modules imported src/hextools/gui/* in CI, where qtpy and bluesky-widgets are not installed: 13 collection errors on 3.11-3.13.

Assisted-by: copilot:claude-opus-4-8
The shutters and rotation motor became optional keyword arguments after exposure_time; the tests still passed them positionally.

Assisted-by: copilot:claude-opus-4-8
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