style: ruff check fix
CI / lint (pull_request) Successful in 19s
CI / test (3.11) (pull_request) Successful in 23s
CI / test (3.12) (pull_request) Successful in 25s
CI / test (3.13) (pull_request) Successful in 30s
Build and Publish / release (push) Failing after 10s
CI / lint (push) Successful in 21s
CI / test (3.11) (push) Successful in 25s
CI / test (3.12) (push) Successful in 25s
CI / test (3.13) (push) Successful in 28s

This commit was merged in pull request #12.
This commit is contained in:
2026-07-27 09:27:20 +02:00
parent 2399e0dddd
commit 5c412902f4
6 changed files with 5 additions and 13 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ def get_config_path(env: str = "dev") -> Path:
# TODO fix logging.
def setup_logger(
name="aareDAQ", base_dir: str | None = f"~/tmp/mxlogs/", config_path: str | None = None
name="aareDAQ", base_dir: str | None = "~/tmp/mxlogs/", config_path: str | None = None
):
# switch to production mode using: $ APP_ENV=prod python main.py
env = os.getenv("APP_ENV", "dev") # default: dev
+1 -3
View File
@@ -75,9 +75,7 @@ class AareErrorCode(StrEnum):
AXC_FAILED = "AXC_FAILED"
AUTO_RASTER_SAMPLE_SKIPPED = "AUTO_RASTER_SAMPLE_SKIPPED"
TRANSFORMATION_INVALID_EXCEPTION = "TRANSFORMATION_INVALID_EXCEPTION"
MAGNET_POSITION_SENSOR_ERROR = (
"MAGNET_POSITION_SENSOR_ERROR"
)
MAGNET_POSITION_SENSOR_ERROR = "MAGNET_POSITION_SENSOR_ERROR"
SMART_MAGNET_FAULT_EXCEPTION = "SMART_MAGNET_FAULT_EXCEPTION"
DOOR_SAFETY_ERROR = "DOOR_SAFETY_ERROR"
+1 -1
View File
@@ -12,7 +12,7 @@ logger = setup_logger("aareDAQ")
def identify_crystal_raster(result, r: RasterGridRequest) -> CenterOfMassModel | None:
images = result.images
if images and any(getattr(img, "spots_low_res", 0) for img in images):
logger.debug(f"Find image by maximum number of low resolution spots")
logger.debug("Find image by maximum number of low resolution spots")
max_image = max(images, key=lambda img: img.spots_low_res)
logger.debug(f"Image with maximum spots_low_res: {max_image}")
logger.debug(f"Maximum spots_low_res value: {max_image.spots_low_res}")
+2 -2
View File
@@ -1,6 +1,5 @@
from enum import Enum
from pydantic import BaseModel
from datetime import datetime
class BatonRequestStatus(Enum):
@@ -58,7 +57,8 @@ class BatonStatus(BaseModel):
def get_user():
import os, getpass
import os
import getpass
try:
return os.getlogin()
-5
View File
@@ -1,7 +1,6 @@
import re
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
from typing import Annotated, List, Literal, Optional, Tuple
from aarecommon.models.beamline import MXBeamline
@@ -102,11 +101,7 @@ class DataCollectionParameters(BaseModel):
default_value = "{date}/{prefix}"
return default_value
# Strip trailing slashes and store original value for comparison
v = str(v).strip("/") # Ensure it's a string and no trailing slashes
original_value = v
# Replace spaces with underscores
v = v.replace(" ", "_")
# Validate directory pattern with macros and allowed characters
-1
View File
@@ -1,4 +1,3 @@
import pytest
from aarecommon.models.models import (
BeamlineStateEnum,
BeamMarkCoeffModel,