From 94aca1501d51a5d5b600266e973a8e4416287f90 Mon Sep 17 00:00:00 2001 From: Tamoor Shahid Date: Thu, 23 Apr 2026 14:50:57 +0100 Subject: [PATCH 1/4] Added plan to i23 init --- src/mx_bluesky/beamlines/i23/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mx_bluesky/beamlines/i23/__init__.py b/src/mx_bluesky/beamlines/i23/__init__.py index d6352ef10a..bf55d5f201 100644 --- a/src/mx_bluesky/beamlines/i23/__init__.py +++ b/src/mx_bluesky/beamlines/i23/__init__.py @@ -1,3 +1,6 @@ from mx_bluesky.beamlines.i23.serial import serial_collection +from mx_bluesky.common.experiment_plans.pin_tip_centring_plan import ( + pin_tip_centre_plan, +) -__all__ = ["serial_collection"] +__all__ = ["serial_collection", "pin_tip_centre_plan"] From 9b91a090e799afbc0273c0bca5eb3aed60c987b1 Mon Sep 17 00:00:00 2001 From: Tamoor Shahid Date: Thu, 23 Apr 2026 16:35:13 +0100 Subject: [PATCH 2/4] Wrapped plan with I23 specific plan --- src/mx_bluesky/beamlines/i23/__init__.py | 6 ++--- src/mx_bluesky/beamlines/i23/centering.py | 28 +++++++++++++++++++++++ uv.lock | 4 ++-- 3 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 src/mx_bluesky/beamlines/i23/centering.py diff --git a/src/mx_bluesky/beamlines/i23/__init__.py b/src/mx_bluesky/beamlines/i23/__init__.py index bf55d5f201..50c5b11bd0 100644 --- a/src/mx_bluesky/beamlines/i23/__init__.py +++ b/src/mx_bluesky/beamlines/i23/__init__.py @@ -1,6 +1,4 @@ +from mx_bluesky.beamlines.i23.centering import optical_centering_plan from mx_bluesky.beamlines.i23.serial import serial_collection -from mx_bluesky.common.experiment_plans.pin_tip_centring_plan import ( - pin_tip_centre_plan, -) -__all__ = ["serial_collection", "pin_tip_centre_plan"] +__all__ = ["serial_collection", "optical_centering_plan"] diff --git a/src/mx_bluesky/beamlines/i23/centering.py b/src/mx_bluesky/beamlines/i23/centering.py new file mode 100644 index 0000000000..52c6cb0a69 --- /dev/null +++ b/src/mx_bluesky/beamlines/i23/centering.py @@ -0,0 +1,28 @@ +from bluesky.utils import MsgGenerator +from dodal.common import inject +from dodal.devices.aithre_lasershaping.goniometer import Goniometer +from dodal.devices.oav.oav_detector import OAV +from dodal.devices.oav.pin_image_recognition import PinTipDetection + +from mx_bluesky.common.experiment_plans.pin_tip_centring_plan import ( + PinTipCentringComposite, + pin_tip_centre_plan, +) + + +def optical_centering_plan( + oav: OAV = inject("OAV"), + gonio: Goniometer = inject("gonio"), + pin_tip_detection: PinTipDetection = inject("pin_tip_detection"), + tip_offset_microns: float = 0, + oav_config_file: str = "/dls/science/groups/i23/aithre/daq_configuration/json/OAVCentring.json", +) -> MsgGenerator: + """Plan to perform optical centering of the sample using the OAV pin tip detection.""" + + composite = PinTipCentringComposite(oav, gonio, pin_tip_detection) + + yield from pin_tip_centre_plan( + composite=composite, + tip_offset_microns=tip_offset_microns, + oav_config_file=oav_config_file, + ) diff --git a/uv.lock b/uv.lock index 1e64d26309..8f31905622 100644 --- a/uv.lock +++ b/uv.lock @@ -802,8 +802,8 @@ wheels = [ [[package]] name = "dls-dodal" -version = "2.2.3.dev4+gcb0a654a8" -source = { git = "https://github.com/DiamondLightSource/dodal.git?rev=main#cb0a654a86d716aeb1698e9c6518f82c7e7325d2" } +version = "2.2.3.dev5+g257b180e8" +source = { git = "https://github.com/DiamondLightSource/dodal.git?rev=main#257b180e8b2cf5121944f3cf518e9ff96da9cb4a" } dependencies = [ { name = "aiofiles", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, { name = "aiohttp", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, From 78d9e0d2343e6a54aa55f5b5897b17ea7cf8021d Mon Sep 17 00:00:00 2001 From: Tamoor Shahid Date: Tue, 28 Apr 2026 16:50:21 +0100 Subject: [PATCH 3/4] Added hello world test plan to remove extra factors --- src/mx_bluesky/beamlines/i23/__init__.py | 3 ++- src/mx_bluesky/beamlines/i23/hello.py | 3 +++ uv.lock | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 src/mx_bluesky/beamlines/i23/hello.py diff --git a/src/mx_bluesky/beamlines/i23/__init__.py b/src/mx_bluesky/beamlines/i23/__init__.py index 50c5b11bd0..0a33d76351 100644 --- a/src/mx_bluesky/beamlines/i23/__init__.py +++ b/src/mx_bluesky/beamlines/i23/__init__.py @@ -1,4 +1,5 @@ from mx_bluesky.beamlines.i23.centering import optical_centering_plan +from mx_bluesky.beamlines.i23.hello import hello from mx_bluesky.beamlines.i23.serial import serial_collection -__all__ = ["serial_collection", "optical_centering_plan"] +__all__ = ["serial_collection", "optical_centering_plan", "hello"] diff --git a/src/mx_bluesky/beamlines/i23/hello.py b/src/mx_bluesky/beamlines/i23/hello.py new file mode 100644 index 0000000000..99f3a9b994 --- /dev/null +++ b/src/mx_bluesky/beamlines/i23/hello.py @@ -0,0 +1,3 @@ +def hello(): + """Plan to print 'Hello World' to the console to test plan works.""" + print("Hello World") diff --git a/uv.lock b/uv.lock index 8f31905622..326cb73c65 100644 --- a/uv.lock +++ b/uv.lock @@ -802,8 +802,8 @@ wheels = [ [[package]] name = "dls-dodal" -version = "2.2.3.dev5+g257b180e8" -source = { git = "https://github.com/DiamondLightSource/dodal.git?rev=main#257b180e8b2cf5121944f3cf518e9ff96da9cb4a" } +version = "2.2.3" +source = { git = "https://github.com/DiamondLightSource/dodal.git?rev=main#729a8b2d8730963455c268cb38d91bfcaa9e50be" } dependencies = [ { name = "aiofiles", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, { name = "aiohttp", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, From 2c20a9a85b9be4c7eeccf7834de64ce6afc9e6bd Mon Sep 17 00:00:00 2001 From: Tamoor Shahid Date: Tue, 5 May 2026 14:12:09 +0100 Subject: [PATCH 4/4] Updated Hello.py and centering.py --- src/mx_bluesky/beamlines/i23/centering.py | 4 ++-- src/mx_bluesky/beamlines/i23/hello.py | 13 +++++++++++-- uv.lock | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/mx_bluesky/beamlines/i23/centering.py b/src/mx_bluesky/beamlines/i23/centering.py index 52c6cb0a69..fbd3ed419b 100644 --- a/src/mx_bluesky/beamlines/i23/centering.py +++ b/src/mx_bluesky/beamlines/i23/centering.py @@ -1,6 +1,6 @@ from bluesky.utils import MsgGenerator from dodal.common import inject -from dodal.devices.aithre_lasershaping.goniometer import Goniometer +from dodal.devices.motors import XYZOmegaStage from dodal.devices.oav.oav_detector import OAV from dodal.devices.oav.pin_image_recognition import PinTipDetection @@ -12,7 +12,7 @@ def optical_centering_plan( oav: OAV = inject("OAV"), - gonio: Goniometer = inject("gonio"), + gonio: XYZOmegaStage = inject("gonio"), pin_tip_detection: PinTipDetection = inject("pin_tip_detection"), tip_offset_microns: float = 0, oav_config_file: str = "/dls/science/groups/i23/aithre/daq_configuration/json/OAVCentring.json", diff --git a/src/mx_bluesky/beamlines/i23/hello.py b/src/mx_bluesky/beamlines/i23/hello.py index 99f3a9b994..cdb80ece07 100644 --- a/src/mx_bluesky/beamlines/i23/hello.py +++ b/src/mx_bluesky/beamlines/i23/hello.py @@ -1,3 +1,12 @@ +import bluesky.plan_stubs as bps + +from mx_bluesky.common.utils.log import LOGGER + + def hello(): - """Plan to print 'Hello World' to the console to test plan works.""" - print("Hello World") + """Plan to log 'Hello World' to the GDA log panel via Bluesky logging.""" + LOGGER.info("Hello World from I23 Bluesky plan!") + + # Example: Read a value and log it + yield from bps.sleep(0.1) # Yield to Bluesky to keep it a valid plan + LOGGER.info("Plan completed successfully") diff --git a/uv.lock b/uv.lock index 326cb73c65..49e409d617 100644 --- a/uv.lock +++ b/uv.lock @@ -802,8 +802,8 @@ wheels = [ [[package]] name = "dls-dodal" -version = "2.2.3" -source = { git = "https://github.com/DiamondLightSource/dodal.git?rev=main#729a8b2d8730963455c268cb38d91bfcaa9e50be" } +version = "2.2.4.dev7+g0beeb3135" +source = { git = "https://github.com/DiamondLightSource/dodal.git?rev=main#0beeb3135ae40248df69aa3c4d04ec43af055436" } dependencies = [ { name = "aiofiles", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, { name = "aiohttp", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },