DAQ: enabled face dtection messages to db. updated aaredb requirement to 0.1.1a49
Build and Publish / test (push) Failing after 1m20s
Build and Publish / build (push) Has been skipped
Build and Publish / Build and Deploy Docs (push) Has been skipped

This commit is contained in:
appleb_m committed 2026-04-30 17:09:10 +02:00
1 parent 65f5205e6f
commit afbc672c77
2 files changed
+30 -12

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ dependencies = [
"python-redis-lock==4.0.0",
"fastapi==0.115.13",
"uvicorn==0.34.2",
"aaredb==0.1.1a45",
"aaredb==0.1.1a49",
"python_multipart==0.0.20",
"websocket-client==1.8.0",
"sseclient-py==1.8.0",
+29 -11
View File
@@ -533,7 +533,6 @@ class AareDAQ:
def _execute_face_detection(
self,
*,
steps: int = 14,
step_size: int = 15,
face_min_ratio: float = 0.3,
@@ -546,22 +545,41 @@ class AareDAQ:
FaceDetectionResult
"""
self.__set_state(BeamlineStateEnum.SampleAlignment)
result = None
result = self._create_face_detection_service().run(
steps=steps,
step_size=step_size,
face_min_ratio=face_min_ratio,
)
try:
self.__aare.send_sample_event(self.sample, SampleEventType.LOOPFACEDETECTING)
if not result.success and report_error:
result = self._create_face_detection_service().run(
steps=steps,
step_size=step_size,
face_min_ratio=face_min_ratio,
)
if not result.success and report_error:
self._handle_operation_error(
operation=DAQOperation.FACE_CENTERING,
sample=self.sample,
error=result.error or Exception("Face detection failed"),
event_type=SampleEventType.LOOPFACEDETECTFAILED,
additional_comment=result.comment,
)
return False
self.__aare.send_sample_event(self.sample, SampleEventType.LOOPFACEDETECTED)
return result
except Exception as e:
logger.error(f"Face detection failed: {e}")
additional_comment = f"{e}" if e is not None else ""
self._handle_operation_error(
operation=DAQOperation.FACE_CENTERING,
sample=self.sample,
error=result.error or Exception("Face detection failed"),
additional_comment=result.comment,
error=e,
event_type=SampleEventType.LOOPFACEDETECTFAILED,
additional_comment=additional_comment,
)
return result
return False
def _execute_raster_sequence(self, grid_request: RasterGridRequest,
auto_center: bool = False) -> CompletedRasterGrid | None: