From f5a1afebf59bfc427888d1cbb7f4186f1612b7cc Mon Sep 17 00:00:00 2001 From: Paul Coe Date: Mon, 23 Feb 2026 21:53:56 +0000 Subject: [PATCH 1/2] Fix #1935 - corrections of discrepancies / inconsistencies in motors * dodal devices motors script hereby has corrections applied to: YXStage class now lists relevant motor axes as Y and X * motor stage with 3 linear axes and 3 rotations is hereby labelled as a six-axis ( rather than five ) stage * inconsistencies in the layout of axes constants are thrashed out (previously linear motors were all in a line, rotation axes isolated perhaps it was a poetic metaphor ? ) * Grammar corrected when spelling out motors as a set of motors rather than as one or more letters and a letter labelled motor --- src/dodal/devices/motors.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/dodal/devices/motors.py b/src/dodal/devices/motors.py index fc84bcc5a27..8969a91695f 100644 --- a/src/dodal/devices/motors.py +++ b/src/dodal/devices/motors.py @@ -7,7 +7,9 @@ from dodal.common.maths import rotate_clockwise, rotate_counter_clockwise -_X, _Y, _Z = "X", "Y", "Z" +_X = "X" +_Y = "Y" +_Z = "Z" _OMEGA = "OMEGA" _POLAR = "POLAR" @@ -17,9 +19,9 @@ class Stage(StandardReadable, ABC): """For these devices, the following co-ordinates are typical but not enforced: - - z is horizontal & parallel to the direction of beam travel + - z is horizontal & parallel to the direction of synchrotron particle travel (whence the x-rays direction) - y is vertical and antiparallel to the force of gravity - - x is the cross product of y🞬z + - x is the cross product of y with z Attributes: prefix (str): Common part of the EPICS PV for all motors, including ":". @@ -33,7 +35,7 @@ class Stage(StandardReadable, ABC): class XThetaStage(Stage): - """Two-axis stage with an x and a theta motor.""" + """Two-axis stage with an x motor and a theta motor.""" def __init__( self, prefix: str, name: str = "", x_infix: str = _X, theta_infix: str = "A" @@ -45,7 +47,7 @@ def __init__( class XYStage(Stage): - """A standard two-axis stage with an x and a y motor.""" + """A standard two-axis stage with an x motor and a y motor.""" def __init__( self, prefix: str, name: str = "", x_infix: str = _X, y_infix: str = _Y @@ -57,7 +59,7 @@ def __init__( class XYZStage(XYStage): - """A standard three-axis stage with an x, a y, and a z motor.""" + """A standard three-axis stage with an x motor, a y motor and a z motor.""" def __init__( self, @@ -236,7 +238,7 @@ def __init__( class XYZPitchYawRollStage(XYZStage): - """Five-axis stage with a standard xyz stage and three axes of rotation: pitch, yaw, + """Six-axis stage with a standard xyz stage and three axes of rotation: pitch, yaw, and roll. """ @@ -306,7 +308,7 @@ def __init__( class YZStage(Stage): - """Two-axis stage with an x and a z motor.""" + """Two-axis stage with an x motor and a y motor.""" def __init__( self, prefix: str, name: str = "", y_infix: str = _Y, z_infix: str = _Z From 0887852fc918f6659ab674cb1c98a314d865080f Mon Sep 17 00:00:00 2001 From: Paul Coe Date: Mon, 23 Feb 2026 21:53:56 +0000 Subject: [PATCH 2/2] Fix #1935 - further corrections as requested in code review * dodal devices motors script hereby has corrections applied to: YZStage class now lists relevant motor axes as Y and Z * replaced whence with longer explanation --- src/dodal/devices/motors.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dodal/devices/motors.py b/src/dodal/devices/motors.py index 8969a91695f..d74bdb23b2b 100644 --- a/src/dodal/devices/motors.py +++ b/src/dodal/devices/motors.py @@ -19,7 +19,8 @@ class Stage(StandardReadable, ABC): """For these devices, the following co-ordinates are typical but not enforced: - - z is horizontal & parallel to the direction of synchrotron particle travel (whence the x-rays direction) + - z is horizontal & parallel to the direction of synchrotron electrons. + ( Usually the x-rays have the same direction: But z is defined by the electrons ) - y is vertical and antiparallel to the force of gravity - x is the cross product of y with z @@ -308,7 +309,7 @@ def __init__( class YZStage(Stage): - """Two-axis stage with an x motor and a y motor.""" + """Two-axis stage with a y motor and a z motor.""" def __init__( self, prefix: str, name: str = "", y_infix: str = _Y, z_infix: str = _Z