Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ reportMissingImports = false # Ignore missing stubs in imported modules
addopts = """
--tb=native -vv --strict-markers --doctest-modules
--doctest-glob="*.rst" --doctest-glob="*.md"
--ignore=docs/examples --ignore=src/hextools/profiles
--ignore=docs/examples --ignore=src/hextools/profiles --ignore=src/hextools/gui
"""
# https://iscinumpy.gitlab.io/post/bound-version-constraints/#watch-for-warnings
filterwarnings = [
Expand Down
2 changes: 1 addition & 1 deletion src/hextools/photon_delivery_system/dclm.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from ophyd_async.epics.core import EpicsDevice
from ophyd_async.epics.motor import Motor as AsyncEpicsMotor

from ..utils import ensure_available
from ..utils import ensure_available, forward_watcher_updates
from .shutter import Shutter, ensure_shutter_closed


Expand Down
14 changes: 13 additions & 1 deletion src/hextools/profiles/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,19 @@
sim_z = SimMotor(name="sim_z", instant=False)


RE.install_suspender(SuspendFloor(storage_ring.beam_current, 100, resume_thresh=390))
# Install a suspender to pause the RunEngine if the beam current drops below 100 mA
# and resume when it rises above 390 mA, unless the ring is in maintenance/shutdown.
try:
_ops_mode = call_in_bluesky_event_loop(storage_ring.operating_mode.get_value())
except Exception as e:
print(f"Could not read storage ring operating mode ({e}); beam suspender not installed.")
else:
if _ops_mode in (NSLS2OpsMode.MAINTENANCE, NSLS2OpsMode.SHUTDOWN):
print(f"Storage ring in {_ops_mode.value} mode; beam suspender not installed.")
else:
RE.install_suspender(
SuspendFloor(storage_ring.beam_current, 100, resume_thresh=390)
)

# Configure baseline supplemental data to include in the metadata of every run.
sd = bpp.SupplementalData(
Expand Down
16 changes: 12 additions & 4 deletions tests/tomography/test_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,15 @@ async def test_tomo_alignment_scan_fails_if_fe_shutter_closed(
)

with pytest.raises(ValueError, match="Front-end shutter is closed"):
RE(tomo_alignment_scan([], rotation_motor, fe_shutter, photon_shutter, 0.1))
RE(
tomo_alignment_scan(
[],
0.1,
fe_shutter=fe_shutter,
photon_shutter=photon_shutter,
rot_motor=rotation_motor,
)
)


@pytest.mark.parametrize(
Expand Down Expand Up @@ -469,14 +477,14 @@ def msg_hook(msg: Msg):
runs: RunEngineResult = RE(
tomo_alignment_scan(
[ktx1],
rotation_motor,
fe_shutter,
photon_shutter,
exposure_time,
num_projections=num_projections,
init_angle=init_angle,
stop_angle=stop_angle,
base_x_offset=base_x_offset,
fe_shutter=fe_shutter,
photon_shutter=photon_shutter,
rot_motor=rotation_motor,
sample_stage_x=None if not include_sample_stage_x else sample_stage_x,
),
cache_docs, # type: ignore
Expand Down