Skip to content

Commit

Permalink
Fix broken device initialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
rtuck99 committed Oct 25, 2024
1 parent f35379c commit e5e7524
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/dodal/beamlines/i04_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def undulator(
f"{BeamlinePrefix(BL).insertion_prefix}-MO-SERVC-01:",
wait_for_connection,
fake_with_ophyd_sim,
id_gap_lookup_table_path="SPECIFY_ME",
bl_prefix=False,
)

Expand Down
2 changes: 1 addition & 1 deletion src/dodal/beamlines/i22.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def dcm() -> DoubleCrystalMonochromator:
d_spacing=(3.13475, "nm"),
)
return DoubleCrystalMonochromator(
motion_prefix=f"{PREFIX.beamline_prefix}-MO-DCM-01:",
prefix=f"{PREFIX.beamline_prefix}-MO-DCM-01:",
temperature_prefix=f"{PREFIX.beamline_prefix}-DI-DCM-01:",
crystal_1_metadata=crystal_1_metadata,
crystal_2_metadata=crystal_2_metadata,
Expand Down
4 changes: 2 additions & 2 deletions src/dodal/beamlines/p38.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,10 @@ def dcm(
return device_instantiation(
DoubleCrystalMonochromator,
"dcm",
"",
f"{BeamlinePrefix(BL).beamline_prefix}-MO-DCM-01:",
wait_for_connection,
fake_with_ophyd_sim,
bl_prefix=False,
motion_prefix=f"{BeamlinePrefix(BL).beamline_prefix}-MO-DCM-01:",
temperature_prefix=f"{BeamlinePrefix(BL).beamline_prefix}-DI-DCM-01:",
crystal_1_metadata=CrystalMetadata(
usage="Bragg",
Expand All @@ -253,6 +252,7 @@ def undulator(
f"{BeamlinePrefix(BL).insertion_prefix}-MO-SERVC-01:",
wait_for_connection,
fake_with_ophyd_sim,
id_gap_lookup_table_path="SPECIFY_ME",
bl_prefix=False,
poles=80,
length=2.0,
Expand Down
16 changes: 8 additions & 8 deletions src/dodal/devices/i22/dcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ class DoubleCrystalMonochromator(StandardReadable):

def __init__(
self,
motion_prefix: str,
prefix: str,
temperature_prefix: str,
crystal_1_metadata: CrystalMetadata | None = None,
crystal_2_metadata: CrystalMetadata | None = None,
name: str = "",
) -> None:
with self.add_children_as_readables():
# Positionable Parameters
self.bragg = Motor(motion_prefix + "BRAGG")
self.offset = Motor(motion_prefix + "OFFSET")
self.perp = Motor(motion_prefix + "PERP")
self.energy = Motor(motion_prefix + "ENERGY")
self.crystal_1_roll = Motor(motion_prefix + "XTAL1:ROLL")
self.crystal_2_roll = Motor(motion_prefix + "XTAL2:ROLL")
self.crystal_2_pitch = Motor(motion_prefix + "XTAL2:PITCH")
self.bragg = Motor(prefix + "BRAGG")
self.offset = Motor(prefix + "OFFSET")
self.perp = Motor(prefix + "PERP")
self.energy = Motor(prefix + "ENERGY")
self.crystal_1_roll = Motor(prefix + "XTAL1:ROLL")
self.crystal_2_roll = Motor(prefix + "XTAL2:ROLL")
self.crystal_2_pitch = Motor(prefix + "XTAL2:PITCH")

# Temperatures
self.backplate_temp = epics_signal_r(float, temperature_prefix + "PT100-7")
Expand Down
4 changes: 2 additions & 2 deletions tests/devices/i22/test_dcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
async def dcm() -> DoubleCrystalMonochromator:
async with DeviceCollector(mock=True):
dcm = DoubleCrystalMonochromator(
motion_prefix="FOO-MO",
prefix="FOO-MO",
temperature_prefix="FOO-DI",
crystal_1_metadata=CrystalMetadata(
usage="Bragg",
Expand Down Expand Up @@ -56,7 +56,7 @@ def test_count_dcm(
async def test_crystal_metadata_not_propagated_when_not_supplied():
async with DeviceCollector(mock=True):
dcm = DoubleCrystalMonochromator(
motion_prefix="FOO-MO",
prefix="FOO-MO",
temperature_prefix="FOO-DI",
crystal_1_metadata=None,
crystal_2_metadata=None,
Expand Down

0 comments on commit e5e7524

Please sign in to comment.