Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from dodal.devices.undulator import UndulatorInKeV
from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra import Zebra
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
from dodal.devices.zebra.zebra_controlled_shutter import MXZebraShutter
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.

I think MX should be Mx - but I guess here is not the place to argue that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would argue that MX is acronym, and as discussed in DiamondLightSource/dodal#2033 (comment), acronyms are all upper case in PEP8. I don't mind having the discussion but:

  • It should be in a wider group
  • If we change away from PEP8 we should then document the exception and fix it everywhere at once

from dodal.devices.zocalo import ZocaloResults
from dodal.plans.preprocessors.verify_undulator_gap import (
verify_undulator_gap_before_run_decorator,
Expand Down Expand Up @@ -139,7 +139,7 @@ def i04_default_grid_detect_and_xray_centre(
xbpm_feedback: XBPMFeedback = inject("xbpm_feedback"),
zebra: Zebra = inject("zebra"),
robot: BartRobot = inject("robot"),
sample_shutter: ZebraShutter = inject("sample_shutter"),
sample_shutter: MXZebraShutter = inject("sample_shutter"),
eiger: EigerDetector = inject("eiger"),
synchrotron: Synchrotron = inject("synchrotron"),
zocalo: ZocaloResults = inject("zocalo"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from dodal.devices.scintillator import InOut, Scintillator
from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra_controlled_shutter import (
ZebraShutter,
MXZebraShutter,
ZebraShutterControl,
ZebraShutterState,
)
Expand All @@ -38,15 +38,15 @@ class FindBeamCentresComposite:
beam_centre: CentreEllipseMethod
attenuator: BinaryFilterAttenuator
zoom_controller: ZoomControllerWithBeamCentres
sample_shutter: ZebraShutter
sample_shutter: MXZebraShutter


def take_oav_image_with_scintillator_in(
image_name: str | None = None,
image_path: str = "dls_sw/i04/software/bluesky/scratch",
transmission: float = 1,
attenuator: BinaryFilterAttenuator = inject("attenuator"),
shutter: ZebraShutter = inject("sample_shutter"),
shutter: MXZebraShutter = inject("sample_shutter"),
oav: OAV = inject("oav"),
robot: BartRobot = inject("robot"),
beamstop: Beamstop = inject("beamstop"),
Expand Down Expand Up @@ -104,7 +104,7 @@ def _prepare_beamline_for_scintillator_images(
backlight: Backlight,
scintillator: Scintillator,
xbpm_feedback: XBPMFeedback,
shutter: ZebraShutter,
shutter: MXZebraShutter,
group: str,
) -> MsgGenerator:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from dodal.devices.synchrotron import Synchrotron
from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra import Zebra
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
from dodal.devices.zebra.zebra_controlled_shutter import MXZebraShutter


@pydantic.dataclasses.dataclass(config={"arbitrary_types_allowed": True})
Expand All @@ -27,7 +27,7 @@ class RotationScanComposite:
jungfrau: CommissioningJungfrauDetector
gonio: VerticalGoniometer
synchrotron: Synchrotron
sample_shutter: ZebraShutter
sample_shutter: MXZebraShutter
zebra: Zebra
xbpm_feedback: XBPMFeedback
hutch_shutter: InterlockedHutchShutter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from dodal.devices.beamlines.i24.dual_backlight import BacklightPositions
from dodal.devices.hutch_shutter import ShutterState
from dodal.devices.zebra.zebra import ArmDemand, I24Axes, Zebra
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
from dodal.devices.zebra.zebra_controlled_shutter import MXZebraShutter
from ophyd_async.fastcs.jungfrau import (
GainMode,
create_jungfrau_external_triggering_info,
Expand Down Expand Up @@ -283,7 +283,7 @@ def _rotation_scan_plan(
def _cleanup_plan(
zebra: Zebra,
jf: CommissioningJungfrauDetector,
zebra_shutter: ZebraShutter,
zebra_shutter: MXZebraShutter,
group="rotation cleanup",
):
LOGGER.info("Tidying up Zebra and Jungfrau...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Zebra,
)
from dodal.devices.zebra.zebra_controlled_shutter import (
ZebraShutter,
MXZebraShutter,
ZebraShutterControl,
)

Expand All @@ -30,7 +30,7 @@
@runtime_checkable
class GridscanSetupDevices(Protocol):
zebra: Zebra
sample_shutter: ZebraShutter
sample_shutter: MXZebraShutter


def setup_zebra_for_gridscan(
Expand Down Expand Up @@ -73,16 +73,19 @@ def setup_zebra_for_gridscan(

def set_shutter_auto_input(zebra: Zebra, input: int, group="set_shutter_trigger"):
"""Set the signal that controls the shutter. We use the second input to the
Zebra's AND_GATE_FOR_AUTO_SHUTTER for this input. ZebraShutter control mode must be in auto for this input to take control
Zebra's AND_GATE_FOR_AUTO_SHUTTER for this input. MXZebraShutter control mode must be in auto for this input to take control

For more details see the ZebraShutter device."""
For more details see the MXZebraShutter device."""
auto_gate = zebra.mapping.AND_GATE_FOR_AUTO_SHUTTER
auto_shutter_control = zebra.logic_gates.and_gates[auto_gate]
yield from bps.abs_set(auto_shutter_control.sources[2], input, group=group)


def configure_zebra_and_shutter_for_auto_shutter(
zebra: Zebra, zebra_shutter: ZebraShutter, input: int, group="use_automatic_shutter"
zebra: Zebra,
zebra_shutter: MXZebraShutter,
input: int,
group="use_automatic_shutter",
):
"""Set the shutter to auto mode, and configure the zebra to trigger the shutter on
an input source. For the input, use one of the source constants in zebra.py
Expand Down Expand Up @@ -113,7 +116,7 @@ def configure_zebra_and_shutter_for_auto_shutter(

def tidy_up_zebra_after_gridscan(
zebra: Zebra,
zebra_shutter: ZebraShutter,
zebra_shutter: MXZebraShutter,
group="tidy_up_zebra_after_gridscan",
wait=True,
ttl_input_for_detector_to_use: int | None = None,
Expand Down Expand Up @@ -150,7 +153,7 @@ def tidy_up_zebra_after_gridscan(

def setup_zebra_for_rotation(
zebra: Zebra,
zebra_shutter: ZebraShutter,
zebra_shutter: MXZebraShutter,
axis: EncEnum = I03Axes.OMEGA,
start_angle: float = 0,
scan_width: float = 360,
Expand Down Expand Up @@ -221,7 +224,7 @@ def setup_zebra_for_rotation(

def tidy_up_zebra_after_rotation_scan(
zebra: Zebra,
zebra_shutter: ZebraShutter,
zebra_shutter: MXZebraShutter,
group="tidy_up_zebra_after_rotation",
wait=True,
):
Expand Down
7 changes: 5 additions & 2 deletions src/mx_bluesky/common/experiment_plans/beamstop_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
from dodal.devices.ipin import IPin, IPinGain
from dodal.devices.mx_phase1.beamstop import Beamstop, BeamstopPositions
from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter, ZebraShutterState
from dodal.devices.zebra.zebra_controlled_shutter import (
MXZebraShutter,
ZebraShutterState,
)
from ophyd_async.core import InOut

from mx_bluesky.common.device_setup_plans.xbpm_feedback import (
Expand All @@ -36,7 +39,7 @@ class BeamstopCheckDevices:
beamstop: Beamstop
detector_motion: DetectorMotion
ipin: IPin
sample_shutter: ZebraShutter
sample_shutter: MXZebraShutter
xbpm_feedback: XBPMFeedback


Expand Down
4 changes: 2 additions & 2 deletions src/mx_bluesky/common/parameters/device_composites.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from dodal.devices.wrapped_axis import WrappedAxis
from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra import Zebra
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
from dodal.devices.zebra.zebra_controlled_shutter import MXZebraShutter
from dodal.devices.zocalo import ZocaloResults
from ophyd_async.epics.motor import Motor

Expand Down Expand Up @@ -78,4 +78,4 @@ class GridDetectThenXRayCentreComposite(FlyScanEssentialDevices[Smargon]):
xbpm_feedback: XBPMFeedback
zebra: Zebra
robot: BartRobot
sample_shutter: ZebraShutter
sample_shutter: MXZebraShutter
4 changes: 2 additions & 2 deletions src/mx_bluesky/hyperion/device_setup_plans/setup_zebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Zebra,
)
from dodal.devices.zebra.zebra_controlled_shutter import (
ZebraShutter,
MXZebraShutter,
)

from mx_bluesky.common.device_setup_plans.setup_zebra_and_shutter import (
Expand All @@ -19,7 +19,7 @@ def arm_zebra(zebra: Zebra):

def setup_zebra_for_panda_flyscan(
zebra: Zebra,
zebra_shutter: ZebraShutter,
zebra_shutter: MXZebraShutter,
group="setup_zebra_for_panda_flyscan",
wait=True,
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
from blueapi.core import BlueskyContext
from dodal.devices.attenuator.attenuator import BinaryFilterAttenuator
from dodal.devices.xspress3.xspress3 import Xspress3
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter, ZebraShutterState
from dodal.devices.zebra.zebra_controlled_shutter import (
MXZebraShutter,
ZebraShutterState,
)

from mx_bluesky.common.utils.context import device_composite_from_context
from mx_bluesky.common.utils.log import LOGGER
Expand All @@ -27,7 +30,7 @@ class OptimizeAttenuationComposite:
"""All devices which are directly or indirectly required by this plan"""

attenuator: BinaryFilterAttenuator
sample_shutter: ZebraShutter
sample_shutter: MXZebraShutter
xspress3mini: Xspress3


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from dodal.devices.webcam import Webcam
from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra import Zebra
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
from dodal.devices.zebra.zebra_controlled_shutter import MXZebraShutter
from dodal.devices.zocalo import ZocaloResults
from dodal.log import LOGGER
from ophyd_async.fastcs.panda import HDFPanda
Expand Down Expand Up @@ -87,7 +87,7 @@ class RobotLoadThenCentreComposite:
panda: HDFPanda
panda_fast_grid_scan: PandAFastGridScan
thawer: Thawer
sample_shutter: ZebraShutter
sample_shutter: MXZebraShutter

# SetEnergyComposite fields
vfm: FocusingMirrorWithStripes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from dodal.devices.undulator import UndulatorInKeV
from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra import Zebra
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
from dodal.devices.zebra.zebra_controlled_shutter import MXZebraShutter
from dodal.plan_stubs.check_topup import check_topup_and_wait_if_necessary
from dodal.plans.preprocessors.verify_undulator_gap import (
verify_undulator_gap_before_run_decorator,
Expand Down Expand Up @@ -86,7 +86,7 @@ class RotationScanComposite(OavSnapshotComposite):
undulator: UndulatorInKeV
synchrotron: Synchrotron
s4_slit_gaps: S4SlitGaps
sample_shutter: ZebraShutter
sample_shutter: MXZebraShutter
zebra: Zebra
oav: OAV
xbpm_feedback: XBPMFeedback
Expand Down
4 changes: 2 additions & 2 deletions src/mx_bluesky/hyperion/parameters/device_composites.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from dodal.devices.undulator import UndulatorInKeV
from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra import Zebra
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
from dodal.devices.zebra.zebra_controlled_shutter import MXZebraShutter
from dodal.devices.zocalo import ZocaloResults
from ophyd_async.fastcs.panda import HDFPanda

Expand All @@ -48,7 +48,7 @@ class HyperionFlyScanXRayCentreComposite(FlyScanEssentialDevices[Smargon]):
panda: HDFPanda
panda_fast_grid_scan: PandAFastGridScan
robot: BartRobot
sample_shutter: ZebraShutter
sample_shutter: MXZebraShutter
backlight: Backlight
xbpm_feedback: XBPMFeedback
zebra_fast_grid_scan: ZebraFastGridScanThreeD
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
from dodal.devices.webcam import Webcam
from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra import Zebra
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
from dodal.devices.zebra.zebra_controlled_shutter import MXZebraShutter
from dodal.devices.zocalo import ZocaloResults
from dodal.devices.zocalo.zocalo_results import _NO_SAMPLE_ID
from dodal.log import LOGGER as DODAL_LOGGER
Expand Down Expand Up @@ -629,7 +629,7 @@ def thawer() -> Generator[Thawer, Any, Any]:


@pytest.fixture
def sample_shutter() -> Generator[ZebraShutter, Any, Any]:
def sample_shutter() -> Generator[MXZebraShutter, Any, Any]:
yield i03.sample_shutter.build(connect_immediately=True, mock=True)


Expand Down
4 changes: 2 additions & 2 deletions tests/system_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from dodal.devices.undulator import UndulatorInKeV
from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra import Zebra
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
from dodal.devices.zebra.zebra_controlled_shutter import MXZebraShutter
from ophyd_async.core import (
AsyncStatus,
completed_status,
Expand Down Expand Up @@ -359,7 +359,7 @@ def system_tests_rotation_devices(
dcm: DCM,
robot: BartRobot,
oav_for_system_test: OAV,
sample_shutter: ZebraShutter,
sample_shutter: MXZebraShutter,
xbpm_feedback: XBPMFeedback,
thawer: Thawer,
beamsize: BeamsizeBase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from dodal.devices.undulator import UndulatorInKeV
from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra import Zebra
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
from dodal.devices.zebra.zebra_controlled_shutter import MXZebraShutter
from dodal.devices.zocalo import ZocaloResults
from ispyb.sqlalchemy import (
BLSample,
Expand Down Expand Up @@ -446,7 +446,7 @@ def composite_for_rotation_scan(
dcm: DCM,
robot: BartRobot,
oav_for_system_test: OAV,
sample_shutter: ZebraShutter,
sample_shutter: MXZebraShutter,
xbpm_feedback: XBPMFeedback,
thawer: Thawer,
beamsize: BeamsizeBase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from dodal.devices.undulator import UndulatorInKeV
from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra import Zebra
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
from dodal.devices.zebra.zebra_controlled_shutter import MXZebraShutter
from dodal.devices.zocalo import ZocaloResults
from dodal.devices.zocalo.zocalo_results import (
ZOCALO_STAGE_GROUP,
Expand Down Expand Up @@ -84,7 +84,7 @@ def i04_grid_detect_then_xrc_default_params(
xbpm_feedback: XBPMFeedback,
zebra: Zebra,
robot: BartRobot,
sample_shutter: ZebraShutter,
sample_shutter: MXZebraShutter,
eiger: EigerDetector,
synchrotron: Synchrotron,
zocalo: ZocaloResults,
Expand Down
Loading
Loading