fix: typing in dispatch
CI / lint (push) Successful in 35s
Docs build and publish / docker (push) Successful in 18s
CI / test (3.11) (push) Canceled after 45s
CI / test (3.12) (push) Canceled after 42s
CI / test (3.13) (push) Canceled after 40s
CI / test-with-beamline-plugins (pxi_bec) (push) Canceled after 37s
CI / test-with-beamline-plugins (pxii_bec) (push) Canceled after 35s
CI / test-with-beamline-plugins (pxiii_bec) (push) Canceled after 32s
CI / test-with-coverage (push) Canceled after 30s
CI / coverage-analysis (push) Canceled after 0s
Build and Publish / release (push) Successful in 34s

This commit was merged in pull request #166.
This commit is contained in:
2026-08-25 09:30:59 +02:00
committed by perl_d
parent 8ad3042e0d
commit 15a7ca464e
@@ -1,5 +1,6 @@
import json
import os
from abc import ABC
from importlib.resources import files
from aarecommon.config.beamline import MXBeamline
@@ -21,7 +22,7 @@ class DefaultAuthDispatch(AuthDispatch):
class DefaultGeometry(Geometry):
def __init__(self, beamline: MXBeamline) -> None:
super().__init__()
with open(files("aarecommon.config") / "beamline_configs" / "beam_centres.json") as f:
with open(str(files("aarecommon.config") / "beamline_configs" / "beam_centres.json")) as f:
measured = json.loads(f.read())[beamline.value.lower()]
self._model = BeamCentre.model_validate(measured)
self._beamline = beamline
@@ -31,7 +32,7 @@ class DefaultGeometry(Geometry):
return self._model.model
class DefaultDispatch(BeamlineDispatch):
class DefaultDispatch(BeamlineDispatch, ABC):
"""Default implementation for anything which can vary between beamlines and/or simulation.
Should be safe and fail rather than assuming anything."""