feat: use aare config for jfjoch images per file
CI / lint (pull_request) Successful in 58s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Failing after 3m16s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Canceled after 3m23s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Canceled after 3m29s
CI / test (3.13) (pull_request) Successful in 3m35s
CI / test (3.12) (pull_request) Successful in 3m35s
CI / test (3.14) (pull_request) Successful in 3m36s
CI / test-with-coverage (pull_request) Successful in 3m38s
CI / coverage-analysis (pull_request) Successful in 4s
CI / lint (push) Successful in 47s
Docs build and publish / docker (push) Successful in 10s
CI / coverage-analysis (push) Canceled after 0s
Build and Publish / release (push) Successful in 43s
CI / test (3.12) (push) Canceled after 1m32s
CI / test-with-beamline-plugins (pxiii_bec) (push) Canceled after 59s
CI / test-with-beamline-plugins (pxi_bec) (push) Canceled after 1m19s
CI / test (3.14) (push) Canceled after 1m35s
CI / test-with-beamline-plugins (pxii_bec) (push) Canceled after 1m4s
CI / test (3.13) (push) Canceled after 1m40s
CI / test-with-coverage (push) Canceled after 1m4s

This commit was merged in pull request #254.
This commit is contained in:
perl_d authored and David Perl committed 2026-10-26 15:55:07 +01:00
1 parent 3e7b4f4c1e
commit 73ab622fb0
2 files changed
+20 -9

No files matched your search

+6 -9
View File
@@ -33,6 +33,7 @@ dependencies = [
"aarelcinfer-client==0.1.1a8",
"matplotlib>=3.10.3",
"httpx>=0.28.1",
"aare-config>=0.1.7",
]
[project.optional-dependencies]
@@ -46,12 +47,10 @@ test = [
"pytest-timeout",
"fakeredis[lua]",
"diff-cover",
"ruff>=0.15"
"ruff>=0.15",
]
docs = [
"zensical"
]
docs = ["zensical"]
[lint]
ignore = ["F401", "F541", "W503", "W504"]
@@ -70,7 +69,7 @@ ignore = ["F401", "F541", "W503", "W504"]
override-dependencies = ["opencv-python; sys_platform == 'nonexistent'"]
[tool.uv.sources]
aaredb = { index = "psi"}
aaredb = { index = "psi" }
[[tool.uv.index]]
name = "psi"
@@ -82,9 +81,7 @@ python_files = ["test_*.py"]
norecursedirs = ["scripts", ".venv", "logs", "docs"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
markers = [
"integration: tests that require external systems or secrets",
]
markers = ["integration: tests that require external systems or secrets"]
[build-system]
requires = ["setuptools>=75.6.0"]
@@ -113,7 +110,7 @@ ignore = [
"DTZ005",
"DTZ006",
]
isort.split-on-trailing-comma=false
isort.split-on-trailing-comma = false
[tool.ruff.format]
skip-magic-trailing-comma = true
+14
View File
@@ -6,6 +6,7 @@ from enum import Enum
from typing import Concatenate, ParamSpec, TypeVar, final
import jfjoch_client
from aare_config import AareConfigClient
from aarecommon.config.beamline import get_jfjoch_url
from aarecommon.config.logger import setup_logger
from aarecommon.errors.exception_handler import AareUserError, JFJochCommunicationError
@@ -55,6 +56,13 @@ class JFJochWrapper:
self._connected: bool = False
_client: ApiClient
_api: DefaultApi
try:
self._config_client = AareConfigClient(
redis_url=f"redis://mx-{bl.value.lower()}-queue-01", key_prefix="config"
)
except Exception:
logger.exception("Failed to create aare config client")
self._config_client = None
def connect(self) -> None:
"""Connect to JFJoch on first use; a no-op once the client exists."""
@@ -178,6 +186,11 @@ class JFJochWrapper:
)
else:
smargon_phi_chi = None
images_per_file = (
self._config_client.jfjoch.n_images_per_file
if self._config_client is not None
else None
) or None
dataset_settings = jfjoch_client.DatasetSettings(
beam_x_pxl=s.diffraction.beam_center_pxl[0],
beam_y_pxl=s.diffraction.beam_center_pxl[1],
@@ -202,6 +215,7 @@ class JFJochWrapper:
beam_size_x_um=s.geom.beam_size_mm.x * 1000.0,
beam_size_y_um=s.geom.beam_size_mm.y * 1000.0,
polarization_factor=1.0,
images_per_file=images_per_file,
)
# settup grid or goniometer settings adn add to dataset settings