diff --git a/src/aare/beamline_dispatch/default/beamline_dispatch.py b/src/aare/beamline_dispatch/default/beamline_dispatch.py index d6577ad4..03175a62 100644 --- a/src/aare/beamline_dispatch/default/beamline_dispatch.py +++ b/src/aare/beamline_dispatch/default/beamline_dispatch.py @@ -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."""