From e027ccbfb181b455bc622be7a1b1a5227cf2dda5 Mon Sep 17 00:00:00 2001 From: perl_d Date: Mon, 31 Aug 2026 17:57:36 +0200 Subject: [PATCH] fix: return beam center in correct format --- src/aare/beamline_dispatch/x10sa/beamline_dispatch.py | 4 ++-- tests/unit/utils/test_beamline_dispatch.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/aare/beamline_dispatch/x10sa/beamline_dispatch.py b/src/aare/beamline_dispatch/x10sa/beamline_dispatch.py index a5121512..cc9c1a9f 100644 --- a/src/aare/beamline_dispatch/x10sa/beamline_dispatch.py +++ b/src/aare/beamline_dispatch/x10sa/beamline_dispatch.py @@ -78,8 +78,8 @@ class _1dModel(BeamCenterModel): self, det_z_mm: ArrayLike, det_y_mm: ArrayLike ) -> tuple[NDArray[np.float64], NDArray[np.float64]]: return ( - self._x_fit[1] + self._x_fit[0] * det_z_mm, - self._y_fit[1] + self._y_fit[0] * det_z_mm, + np.asarray([self._x_fit[1] + self._x_fit[0] * det_z_mm]), + np.asarray([self._y_fit[1] + self._y_fit[0] * det_z_mm]), ) diff --git a/tests/unit/utils/test_beamline_dispatch.py b/tests/unit/utils/test_beamline_dispatch.py index 5da1bbd5..91ad8812 100644 --- a/tests/unit/utils/test_beamline_dispatch.py +++ b/tests/unit/utils/test_beamline_dispatch.py @@ -45,8 +45,8 @@ def test_pxii_dispatch_beam_center(): with patch.dict("os.environ", {"BEAMLINE": "X10SA"}): dispatch = get_beamline_dispatch() beam_center = dispatch.geo.beam_centre_model.predict(300, 62) - assert np.isclose(beam_center[0], 2081.8, atol=1) - assert np.isclose(beam_center[1], 2242.05, atol=1) + assert np.isclose(beam_center[0][0], 2081.8, atol=1) + assert np.isclose(beam_center[1][0], 2242.05, atol=1) @pytest.mark.skipif(