fix: pass timeout to smargon nudge #7
No files matched your search
@@ -155,7 +155,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ./e2e_files
|
||||
pytest -v --start-servers --files-path ./e2e_files ./mx_bec/tests/e2e
|
||||
pytest -v --start-servers --files-path "$PWD/e2e_files" ./mx_bec/tests/e2e
|
||||
|
||||
- name: Show server logs if the end-to-end tests fail
|
||||
if: failure() && matrix.suite == 'e2e'
|
||||
|
||||
@@ -54,7 +54,12 @@ class Smargon(HttpOphydDevice):
|
||||
chi = Cpt(HttpDeviceSignal, axis_identifier="CHI", tolerance=0.01)
|
||||
|
||||
def nudge_in_lab_frame(
|
||||
self, x_mm: float, y_mm: float, z_mm: float = 0.0, omega_deg: float = 0.0
|
||||
self,
|
||||
x_mm: float,
|
||||
y_mm: float,
|
||||
z_mm: float = 0.0,
|
||||
omega_deg: float = 0.0,
|
||||
timeout_s: float | None = 2.0,
|
||||
):
|
||||
"""Apply a relative move in the lab frame (adjusted for the rotation angle, assuming that
|
||||
the frames are identical when omega = phi = chi = 0). `omega_deg` is the angle of the
|
||||
@@ -66,7 +71,7 @@ class Smargon(HttpOphydDevice):
|
||||
self.x.set(self.x.get() + x_mm)
|
||||
& self.y.set(self.y.get() + y_mm)
|
||||
& self.z.set(self.z.get() + z_mm)
|
||||
).wait()
|
||||
).wait(timeout=timeout_s)
|
||||
|
||||
def _lab_frame_offset_to_smargon_nudge(
|
||||
self, x_mm: float, y_mm: float, z_mm: float = 0.0, omega_deg: float = 0.0
|
||||
|
||||
@@ -66,11 +66,11 @@ def test_set_sends_only_that_axis(smargon):
|
||||
|
||||
def test_nudge_in_lab_frame_at_zero_angles(smargon):
|
||||
# With omega = phi = chi = 0 a lab-frame x offset is a smargon -z move, y -> -x, z -> -y
|
||||
smargon.nudge_in_lab_frame(0.2, 0.0, 0.0).wait(timeout=2)
|
||||
smargon.nudge_in_lab_frame(0.2, 0.0, 0.0)
|
||||
assert smargon.z.get() == pytest.approx(-0.2, abs=TOL)
|
||||
assert smargon.x.get() == pytest.approx(0.0, abs=TOL)
|
||||
assert smargon.y.get() == pytest.approx(0.0, abs=TOL)
|
||||
smargon.nudge_in_lab_frame(0.0, 0.2, 0.0).wait(timeout=2)
|
||||
smargon.nudge_in_lab_frame(0.0, 0.2, 0.0)
|
||||
assert smargon.x.get() == pytest.approx(-0.2, abs=TOL)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user