feat: add beamline dispatch for x06da
CI / lint (pull_request) Successful in 46s
CI / test (3.11) (pull_request) Successful in 47s
CI / test (3.13) (pull_request) Successful in 48s
CI / test (3.12) (pull_request) Successful in 50s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m0s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 58s
CI / test-with-coverage (pull_request) Failing after 1m17s
CI / coverage-analysis (pull_request) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m19s
CI / lint (push) Canceled after 34s
CI / test (3.11) (push) Canceled after 33s
CI / test (3.12) (push) Canceled after 30s
CI / test (3.13) (push) Canceled after 28s
CI / test-with-beamline-plugins (pxi_bec) (push) Canceled after 25s
CI / test-with-beamline-plugins (pxii_bec) (push) Canceled after 23s
CI / test-with-beamline-plugins (pxiii_bec) (push) Canceled after 20s
CI / test-with-coverage (push) Canceled after 17s
CI / coverage-analysis (push) Canceled after 0s
Build and Publish / release (push) Successful in 24s
CI / lint (pull_request) Successful in 46s
CI / test (3.11) (pull_request) Successful in 47s
CI / test (3.13) (pull_request) Successful in 48s
CI / test (3.12) (pull_request) Successful in 50s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m0s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 58s
CI / test-with-coverage (pull_request) Failing after 1m17s
CI / coverage-analysis (pull_request) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m19s
CI / lint (push) Canceled after 34s
CI / test (3.11) (push) Canceled after 33s
CI / test (3.12) (push) Canceled after 30s
CI / test (3.13) (push) Canceled after 28s
CI / test-with-beamline-plugins (pxi_bec) (push) Canceled after 25s
CI / test-with-beamline-plugins (pxii_bec) (push) Canceled after 23s
CI / test-with-beamline-plugins (pxiii_bec) (push) Canceled after 20s
CI / test-with-coverage (push) Canceled after 17s
CI / coverage-analysis (push) Canceled after 0s
Build and Publish / release (push) Successful in 24s
This commit was merged in pull request #123.
This commit is contained in:
@@ -1,4 +1,54 @@
|
||||
from typing import Any
|
||||
|
||||
from aare.beamline_dispatch.default.beamline_dispatch import DefaultDispatch
|
||||
from aare.beamline_dispatch.protocols import BecMacros
|
||||
|
||||
|
||||
class X06daDispatch(DefaultDispatch): ...
|
||||
class X06daBecMacros(BecMacros):
|
||||
def __init__(self) -> None:
|
||||
from pxiii_bec.macros.build_devices import ( # pyright: ignore[reportMissingImports, reportMissingModuleSource]
|
||||
save_and_reload,
|
||||
save_current_position,
|
||||
)
|
||||
from pxiii_bec.macros.init_beamline import ( # pyright: ignore[reportMissingImports, reportMissingModuleSource]
|
||||
init_beamline_environment,
|
||||
)
|
||||
from pxiii_bec.macros.pxiii_energy import ( # pyright: ignore[reportMissingImports, reportMissingModuleSource]
|
||||
bl_energy,
|
||||
get_current_energy,
|
||||
mono_pitch_scan,
|
||||
)
|
||||
|
||||
self.save_and_reload = save_and_reload
|
||||
self.save_current_position = save_current_position
|
||||
self.init_beamline_environment = init_beamline_environment
|
||||
|
||||
def _bl_energy(energy_ev, move_gap=True, mono_scan=True, plot=True):
|
||||
return bl_energy(energy_ev=energy_ev, plot=plot)
|
||||
|
||||
self.bl_energy = _bl_energy
|
||||
self.get_current_energy = get_current_energy
|
||||
self.mono_pitch_scan = mono_pitch_scan
|
||||
|
||||
@staticmethod
|
||||
def save_and_reload() -> tuple[Any, Any]: ...
|
||||
@staticmethod
|
||||
def save_current_position(device, position, axis=None, force=False, max_delta=0.5) -> None: ...
|
||||
@staticmethod
|
||||
def init_beamline_environment() -> tuple[Any, Any]: ...
|
||||
@staticmethod
|
||||
def bl_energy(energy_ev, move_gap=True, mono_scan=True, plot=True): ...
|
||||
@staticmethod
|
||||
def get_current_energy(): ...
|
||||
@staticmethod
|
||||
def mono_pitch_scan(plot=True): ...
|
||||
|
||||
|
||||
class X06daDispatch(DefaultDispatch):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self._bec_macros = X06daBecMacros()
|
||||
|
||||
@property
|
||||
def bec_macros(self) -> BecMacros:
|
||||
return self._bec_macros
|
||||
|
||||
@@ -5,6 +5,7 @@ import pytest
|
||||
|
||||
from aare.beamline_dispatch.beamline_dispatch import get_beamline_dispatch
|
||||
from aare.beamline_dispatch.simulated import SimulatedDispatch
|
||||
from aare.beamline_dispatch.x06da import X06daDispatch
|
||||
from aare.beamline_dispatch.x10sa import X10saDispatch
|
||||
|
||||
|
||||
@@ -40,6 +41,6 @@ def test_pxii_dispatch_can_be_instantiated():
|
||||
importlib.util.find_spec("pxiii_bec") is None, reason="run only for pxiii flavour"
|
||||
)
|
||||
def test_pxiii_dispatch_can_be_instantiated():
|
||||
with patch.dict("os.environ", {"BEAMLINE": "X06DA"}), pytest.raises(TypeError) as e:
|
||||
_ = get_beamline_dispatch()
|
||||
assert e.match("Can't instantiate abstract class")
|
||||
with patch.dict("os.environ", {"BEAMLINE": "X06DA"}):
|
||||
dispatch = get_beamline_dispatch()
|
||||
assert isinstance(dispatch, X06daDispatch)
|
||||
|
||||
Reference in New Issue
Block a user