fix: new import locations and types for bec macros
CI / lint (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / lint (pull_request) Failing after 39s
CI / test (3.12) (pull_request) Successful in 1m4s
CI / test (3.13) (pull_request) Successful in 1m0s
CI / test (3.14) (pull_request) Successful in 1m4s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m9s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m18s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m17s
CI / test-with-coverage (pull_request) Successful in 1m33s
CI / coverage-analysis (pull_request) Failing after 4s

This commit is contained in:
2026-08-25 18:03:31 +02:00
committed by perl_d
parent 21be0bf0cf
commit db046d9893
5 changed files with 21 additions and 21 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ class BecMacros(ABC):
def save_current_position(device, position, axis=None, force=False, max_delta=0.5) -> None: ...
@staticmethod
@abstractmethod
def init_beamline_environment() -> tuple[Any, Any]: ...
def init_beamline_environment() -> tuple[Any, Any, Any]: ...
@staticmethod
@abstractmethod
def bl_energy(energy_ev, move_gap=True, mono_scan=True, plot=True): ...
@@ -17,8 +17,8 @@ class SimulatedBecMacros(BecMacros):
@staticmethod
def save_current_position(device, position, axis=None, force=False, max_delta=0.5) -> None: ...
@staticmethod
def init_beamline_environment() -> tuple[Any, Any]:
return (None, None)
def init_beamline_environment() -> tuple[Any, Any, Any]:
return (None, None, None)
@staticmethod
def bl_energy(energy_ev, move_gap=True, mono_scan=True, plot=True): ...
@@ -41,7 +41,7 @@ class X06daBecMacros(BecMacros):
@staticmethod
def save_current_position(device, position, axis=None, force=False, max_delta=0.5) -> None: ...
@staticmethod
def init_beamline_environment() -> tuple[Any, Any]: ...
def init_beamline_environment() -> tuple[Any, Any, Any]: ...
@staticmethod
def bl_energy(energy_ev, move_gap=True, mono_scan=True, plot=True): ...
@staticmethod
@@ -12,9 +12,6 @@ class X10SaBecMacros(BecMacros):
save_and_reload,
save_current_position,
)
from pxii_bec.macros.init_beamline import ( # pyright: ignore[reportMissingImports, reportMissingModuleSource]
init_beamline_environment,
)
from pxii_bec.macros.katscripts import ( # pyright: ignore[reportMissingImports, reportMissingModuleSource]
auto_exposure,
)
@@ -23,6 +20,9 @@ class X10SaBecMacros(BecMacros):
get_current_energy,
mono_pitch_scan,
)
from pxii_bec.scripts.init_beamline import ( # pyright: ignore[reportMissingImports, reportMissingModuleSource]
init_beamline_environment,
)
self.save_and_reload = save_and_reload
self.save_current_position = save_current_position
@@ -37,7 +37,7 @@ class X10SaBecMacros(BecMacros):
@staticmethod
def save_current_position(device, position, axis=None, force=False, max_delta=0.5) -> None: ...
@staticmethod
def init_beamline_environment() -> tuple[Any, Any]: ...
def init_beamline_environment() -> tuple[Any, Any, Any]: ...
@staticmethod
def bl_energy(energy_ev, move_gap=True, mono_scan=True, plot=True): ...
@staticmethod
+13 -13
View File
@@ -112,24 +112,24 @@ class BECClientWorker:
def _init_beamline_environment(self):
try:
self.position_devices, self.planner = self.macros.init_beamline_environment()
self._backlight_brightness = self.position_devices["bl_bright"]
self._frontlight_brightness = self.position_devices["fl_bright"]
self._zoom = self.dev.scam_zoom
self._ring_current = self.dev.sls_current
_, self.position_devices, self.planner = self.macros.init_beamline_environment()
self._backlight_brightness = self.position_devices["bl_bright"] # type: ignore
self._frontlight_brightness = self.position_devices["fl_bright"] # type: ignore
self._zoom = self.dev.scam_zoom # type: ignore
self._ring_current = self.dev.sls_current # type: ignore
except Exception as e:
logger.error(f"Error initialising planner and position devices: {e}")
self.position_devices = None
self.planner = None
self._backlight_brightness = None
self._frontlight_brightness = None
self.position_devices = None # type: ignore
self.planner = None # type: ignore
self._backlight_brightness = None # type: ignore
self._frontlight_brightness = None # type: ignore
try:
self._zoom = self.dev.scam_zoom
self._ring_current = self.dev.sls_current
self._zoom = self.dev.scam_zoom # type: ignore
self._ring_current = self.dev.sls_current # type: ignore
except Exception as e:
logger.exception("Error initialising zoom and ring_current")
self._zoom = None
self.ring_current = None
self._zoom = None # type: ignore
self.ring_current = None # type: ignore
raise RuntimeError(f"Error initialising BEC devices: {e}") from e
def read_current_state(self) -> BeamlineStateEnum: