diff --git a/conftest.py b/conftest.py index ede84a755a2..38101f7e9d2 100644 --- a/conftest.py +++ b/conftest.py @@ -14,7 +14,7 @@ from tests.devices.test_daq_configuration import MOCK_DAQ_CONFIG_PATH from tests.test_data import ( TEST_DISPLAY_CONFIG, - TEST_OAV_ZOOM_LEVELS_XML, + TEST_OAV_ZOOM_LEVELS, ) from dodal.common.beamlines import beamline_utils @@ -27,7 +27,7 @@ mock_paths = [ ("DAQ_CONFIGURATION_PATH", MOCK_DAQ_CONFIG_PATH), - ("ZOOM_PARAMS_FILE", TEST_OAV_ZOOM_LEVELS_XML), + ("ZOOM_PARAMS_FILE", TEST_OAV_ZOOM_LEVELS), ("DISPLAY_CONFIG", TEST_DISPLAY_CONFIG), ("LOOK_UPTABLE_DIR", LOOKUP_TABLE_PATH), ] diff --git a/src/dodal/devices/oav/oav_parameters.py b/src/dodal/devices/oav/oav_parameters.py index 958dc46613d..ad55b4fc41d 100644 --- a/src/dodal/devices/oav/oav_parameters.py +++ b/src/dodal/devices/oav/oav_parameters.py @@ -1,11 +1,13 @@ -import json from abc import abstractmethod from collections import ChainMap from dataclasses import dataclass -from typing import Any, Generic, TypeVar +from typing import Any, Generic, Literal, TypedDict, TypeVar from xml.etree import ElementTree from xml.etree.ElementTree import Element +from daq_config_server.client import ConfigServer +from daq_config_server.models import DisplayConfig + # GDA currently assumes this aspect ratio for the OAV window size. # For some beamline this doesn't affect anything as the actual OAV aspect ratio # matches. Others need to take it into account to rescale the values stored in @@ -36,21 +38,25 @@ def __init__( ): self.oav_config_json: str = oav_config_json self.context = context + config_server = ConfigServer(url="https://daq-config.diamond.ac.uk") - self.global_params, self.context_dicts = self.load_json(self.oav_config_json) + self.global_params, self.context_dicts = self.load_json( + config_server, self.oav_config_json + ) self.active_params: ChainMap = ChainMap( self.context_dicts[self.context], self.global_params ) self.update_self_from_current_context() @staticmethod - def load_json(filename: str) -> tuple[dict[str, Any], dict[str, dict]]: + def load_json( + config_server: ConfigServer, filename: str + ) -> tuple[dict[str, Any], dict[str, dict]]: """ - Loads the json from the specified file, and returns a dict with all the + Loads the specified file from the config server, and returns a dict with all the individual top-level k-v pairs, and one with all the subdicts. """ - with open(filename) as f: - raw_params: dict[str, Any] = json.load(f) + raw_params: dict[str, Any] = config_server.get_file_contents(filename, dict) global_params = { k: raw_params.pop(k) for k, v in list(raw_params.items()) @@ -124,18 +130,21 @@ class OAVConfigBase(Generic[ParamType]): def __init__(self, zoom_params_file: str): self.zoom_params = self._get_zoom_params(zoom_params_file) - def _get_zoom_params(self, zoom_params_file: str): - tree = ElementTree.parse(zoom_params_file) - root = tree.getroot() - return root.findall(".//zoomLevel") + def _get_zoom_params(self, zoom_params_file: str) -> dict: + config_server = ConfigServer(url="https://daq-config.diamond.ac.uk") + return config_server.get_file_contents(zoom_params_file, dict)[ + "JCameraManSettings" + ] def _read_zoom_params(self) -> dict: um_per_pix = {} - for node in self.zoom_params: - zoom = str(_get_element_as_float(node, "level")) - um_pix_x = _get_element_as_float(node, "micronsPerXPixel") - um_pix_y = _get_element_as_float(node, "micronsPerYPixel") - um_per_pix[zoom] = (um_pix_x, um_pix_y) + zoom_levels: list[dict] = self.zoom_params["levels"]["zoomLevel"] + for level in zoom_levels: + zoom = level["level"] + um_per_pix[zoom] = ( + float(level["micronsPerXPixel"]), + float(level["micronsPerYPixel"]), + ) return um_per_pix @abstractmethod @@ -166,19 +175,14 @@ def __init__( self.display_config = self._get_display_config(display_config_file) super().__init__(zoom_params_file) - def _get_display_config(self, display_config_file: str): - with open(display_config_file) as f: - file_lines = f.readlines() - return file_lines + def _get_display_config(self, display_config_file: str) -> DisplayConfig: + config_server = ConfigServer(url="https://daq-config.diamond.ac.uk") + return config_server.get_file_contents(display_config_file, DisplayConfig) def _read_display_config(self) -> dict: crosshairs = {} - for i in range(len(self.display_config)): - if self.display_config[i].startswith("zoomLevel"): - zoom = self.display_config[i].split(" = ")[1].strip() - x = int(self.display_config[i + 1].split(" = ")[1]) - y = int(self.display_config[i + 2].split(" = ")[1]) - crosshairs[zoom] = (x, y) + for zoom, values in self.display_config.zoom_levels.items(): + crosshairs[str(zoom)] = (values.crosshairX, values.crosshairY) return crosshairs def get_parameters(self) -> dict[str, ZoomParamsCrosshair]: diff --git a/src/dodal/testing/__init__.py b/src/dodal/testing/__init__.py new file mode 100644 index 00000000000..bbe02de4674 --- /dev/null +++ b/src/dodal/testing/__init__.py @@ -0,0 +1,4 @@ +from .mock_config_server.mock_config_server import MockConfigServer +from .mock_config_server.mock_oav_config import MockOavConfig + +__all__ = ["MockConfigServer", "MockOavConfig"] diff --git a/src/dodal/testing/mock_config_server/__init__.py b/src/dodal/testing/mock_config_server/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/dodal/testing/mock_config_server/mock_config_server.py b/src/dodal/testing/mock_config_server/mock_config_server.py new file mode 100644 index 00000000000..1868b352e2a --- /dev/null +++ b/src/dodal/testing/mock_config_server/mock_config_server.py @@ -0,0 +1,47 @@ +import json +from pathlib import Path +from typing import Any + +from daq_config_server.client import ConfigServer +from daq_config_server.models import ( + ConfigModel, +) + +from .mock_oav_config import MockOavConfig + + +class MockConfigServer(ConfigServer): + def get_file_contents( + self, + file_path: str | Path, + desired_return_type: type[Any] = str, + reset_cached_result: bool = False, + ) -> Any: + print() + if str(file_path).endswith("display.configuration"): + return MockOavConfig.get_display_config() + elif str(file_path).endswith("jCameraManZoomLevels.xml"): + return MockOavConfig.get_zoom_params_file() + elif str(file_path).endswith("OAVCentring.json"): + return MockOavConfig.get_oav_config_json() + else: + return self._fake_config_server_read( + file_path, desired_return_type, reset_cached_result + ) + + def _fake_config_server_read( + self, + filepath: str | Path, + desired_return_type: type[str] | type[dict] | ConfigModel = str, + reset_cached_result: bool = False, + ) -> Any: + filepath = Path(filepath) + # Minimal logic required for unit tests + with filepath.open("r") as f: + contents = f.read() + if desired_return_type is str: + return contents + elif desired_return_type is dict: + return json.loads(contents) + elif issubclass(desired_return_type, ConfigModel): # type: ignore + return desired_return_type.model_validate(json.loads(contents)) diff --git a/src/dodal/testing/mock_config_server/mock_oav_config.py b/src/dodal/testing/mock_config_server/mock_oav_config.py new file mode 100644 index 00000000000..cab53d42d6d --- /dev/null +++ b/src/dodal/testing/mock_config_server/mock_oav_config.py @@ -0,0 +1,182 @@ +from daq_config_server.models import ( + DisplayConfig, + DisplayConfigData, +) + + +class MockOavConfig: + @staticmethod + def get_oav_config_json(): + return { + "exposure": 0.075, + "acqPeriod": 0.05, + "gain": 1.0, + "minheight": 70, + "oav": "OAV", + "mxsc_input": "CAM", + "min_callback_time": 0.080, + "close_ksize": 11, + "direction": 0, + "pinTipCentring": { + "zoom": 1.0, + "preprocess": 8, + "preProcessKSize": 21, + "CannyEdgeUpperThreshold": 20.0, + "CannyEdgeLowerThreshold": 5.0, + "brightness": 20, + "max_tip_distance": 300, + "mxsc_input": "proc", + "minheight": 10, + "min_callback_time": 0.15, + "filename": "/dls_sw/prod/R3.14.12.7/support/adPython/2-1-11/adPythonApp/scripts/adPythonMxSampleDetect.py", + }, + "loopCentring": { + "zoom": 5.0, + "preprocess": 8, + "preProcessKSize": 21, + "CannyEdgeUpperThreshold": 20.0, + "CannyEdgeLowerThreshold": 5.0, + "brightness": 20, + "filename": "/dls_sw/prod/R3.14.12.7/support/adPython/2-1-11/adPythonApp/scripts/adPythonMxSampleDetect.py", + "max_tip_distance": 300, + "minheight": 10, + }, + "xrayCentring": { + "zoom": 7.5, + "preprocess": 8, + "preProcessKSize": 31, + "CannyEdgeUpperThreshold": 30.0, + "CannyEdgeLowerThreshold": 5.0, + "close_ksize": 3, + "filename": "/dls_sw/prod/R3.14.12.7/support/adPython/2-1-11/adPythonApp/scripts/adPythonMxSampleDetect.py", + "brightness": 80, + }, + "rotationAxisAlign": { + "zoom": 10.0, + "preprocess": 8, + "preProcessKSize": 21, + "CannyEdgeUpperThreshold": 20.0, + "CannyEdgeLowerThreshold": 5.0, + "filename": "/dls_sw/prod/R3.14.12.7/support/adPython/2-1-11/adPythonApp/scripts/adPythonMxSampleDetect.py", + "brightness": 100, + }, + "SmargonOffsets1": { + "zoom": 1.0, + "preprocess": 8, + "preProcessKSize": 21, + "CannyEdgeUpperThreshold": 50.0, + "CannyEdgeLowerThreshold": 5.0, + "brightness": 80, + }, + "SmargonOffsets2": { + "zoom": 5.0, + "preprocess": 8, + "preProcessKSize": 11, + "CannyEdgeUpperThreshold": 50.0, + "CannyEdgeLowerThreshold": 5.0, + "brightness": 90, + }, + } + + @staticmethod + def get_zoom_params_file(): + return { + "JCameraManSettings": { + "levels": { + "zoomLevel": [ + { + "level": "1.0", + "position": "0", + "micronsPerXPixel": "2.87", + "micronsPerYPixel": "2.87", + }, + { + "level": "2.5", + "position": "10", + "micronsPerXPixel": "2.31", + "micronsPerYPixel": "2.31", + }, + { + "level": "5.0", + "position": "25", + "micronsPerXPixel": "1.58", + "micronsPerYPixel": "1.58", + }, + { + "level": "7.5", + "position": "50", + "micronsPerXPixel": "0.806", + "micronsPerYPixel": "0.806", + }, + { + "level": "10.0", + "position": "75", + "micronsPerXPixel": "0.438", + "micronsPerYPixel": "0.438", + }, + { + "level": "15.0", + "position": "90", + "micronsPerXPixel": "0.302", + "micronsPerYPixel": "0.302", + }, + ] + }, + "tolerance": "1.0", + } + } + + @staticmethod + def get_display_config(): + return DisplayConfig( + zoom_levels={ + 1.0: DisplayConfigData( + crosshairX=477, + crosshairY=359, + topLeftX=383, + topLeftY=253, + bottomRightX=410, + bottomRightY=278, + ), + 2.5: DisplayConfigData( + crosshairX=493, + crosshairY=355, + topLeftX=340, + topLeftY=283, + bottomRightX=388, + bottomRightY=322, + ), + 5.0: DisplayConfigData( + crosshairX=517, + crosshairY=350, + topLeftX=268, + topLeftY=326, + bottomRightX=354, + bottomRightY=387, + ), + 7.5: DisplayConfigData( + crosshairX=549, + crosshairY=437, + topLeftX=248, + topLeftY=394, + bottomRightX=377, + bottomRightY=507, + ), + 10.0: DisplayConfigData( + crosshairX=613, + crosshairY=344, + topLeftX=2, + topLeftY=489, + bottomRightX=206, + bottomRightY=630, + ), + 15.0: DisplayConfigData( + crosshairX=693, + crosshairY=339, + topLeftX=1, + topLeftY=601, + bottomRightX=65, + bottomRightY=767, + ), + }, + ) diff --git a/system_tests/test_oav_system.py b/system_tests/test_oav_system.py index bfecb9622b3..0941389cc3a 100644 --- a/system_tests/test_oav_system.py +++ b/system_tests/test_oav_system.py @@ -4,7 +4,7 @@ from ophyd_async.core import init_devices from tests.test_data import ( TEST_DISPLAY_CONFIG, - TEST_OAV_ZOOM_LEVELS_XML, + TEST_OAV_ZOOM_LEVELS, ) from dodal.devices.oav.oav_detector import OAV, OAVConfig @@ -18,7 +18,7 @@ @pytest.fixture async def oav() -> OAV: - oav_config = OAVConfig(TEST_OAV_ZOOM_LEVELS_XML, TEST_DISPLAY_CONFIG) + oav_config = OAVConfig(TEST_OAV_ZOOM_LEVELS, TEST_DISPLAY_CONFIG) async with init_devices(connect=True): oav = OAV("", config=oav_config, name="oav") return oav @@ -39,7 +39,7 @@ def take_snapshot_with_grid(oav: OAV, snapshot_filename, snapshot_directory): @pytest.mark.skip(reason="Don't want to actually take snapshots during testing.") def test_grid_overlay(run_engine: RunEngine): beamline = "BL03I" - oav_params = OAVConfig(TEST_OAV_ZOOM_LEVELS_XML, TEST_DISPLAY_CONFIG) + oav_params = OAVConfig(TEST_OAV_ZOOM_LEVELS, TEST_DISPLAY_CONFIG) oav = OAV(name="oav", prefix=f"{beamline}", config=oav_params) snapshot_filename = "snapshot" snapshot_directory = "." diff --git a/tests/conftest.py b/tests/conftest.py index b326effebac..4c4d1f657c5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -15,6 +15,7 @@ from dodal.devices.baton import Baton from dodal.devices.detector import DetectorParams from dodal.devices.detector.det_dim_constants import EIGER2_X_16M_SIZE +from dodal.testing import MockConfigServer from dodal.utils import ( DeviceInitializationController, collect_factories, @@ -88,3 +89,20 @@ async def baton_in_commissioning_mode() -> AsyncGenerator[Baton]: set_mock_value(baton.commissioning, True) yield baton set_commissioning_signal(None) + + +IMPLEMENTED_CONFIG_CLIENTS = [] + + +@pytest.fixture(autouse=True) +def mock_config_server(): + # Don't actually talk to central service during unit tests, and reset caches between test + + for client in IMPLEMENTED_CONFIG_CLIENTS: + client.cache_clear() # type: ignore - currently no option for "cachable" static type + + with patch( + "daq_config_server.client.ConfigServer.get_file_contents", + side_effect=MockConfigServer().get_file_contents, + ): + yield diff --git a/tests/devices/oav/conftest.py b/tests/devices/oav/conftest.py index 579d6578ff5..1a28f5cd788 100644 --- a/tests/devices/oav/conftest.py +++ b/tests/devices/oav/conftest.py @@ -5,12 +5,12 @@ from dodal.devices.oav.oav_detector import OAVBeamCentreFile, OAVBeamCentrePV from dodal.devices.oav.oav_parameters import OAVConfig, OAVConfigBeamCentre -from tests.test_data import TEST_DISPLAY_CONFIG, TEST_OAV_ZOOM_LEVELS_XML +from tests.test_data import TEST_DISPLAY_CONFIG, TEST_OAV_ZOOM_LEVELS @pytest.fixture async def oav() -> OAVBeamCentreFile: - oav_config = OAVConfigBeamCentre(TEST_OAV_ZOOM_LEVELS_XML, TEST_DISPLAY_CONFIG) + oav_config = OAVConfigBeamCentre(TEST_OAV_ZOOM_LEVELS, TEST_DISPLAY_CONFIG) async with init_devices(mock=True, connect=True): oav = OAVBeamCentreFile("", config=oav_config, name="oav") zoom_levels_list = ["1.0x", "3.0x", "5.0x", "7.5x", "10.0x"] @@ -25,7 +25,7 @@ async def oav() -> OAVBeamCentreFile: @pytest.fixture async def oav_beam_centre_pv_roi() -> OAVBeamCentrePV: - oav_config = OAVConfig(TEST_OAV_ZOOM_LEVELS_XML) + oav_config = OAVConfig(TEST_OAV_ZOOM_LEVELS) async with init_devices(mock=True, connect=True): oav = OAVBeamCentrePV("", config=oav_config, name="oav") zoom_levels_list = ["1.0x", "3.0x", "5.0x", "7.5x", "10.0x"] @@ -40,7 +40,7 @@ async def oav_beam_centre_pv_roi() -> OAVBeamCentrePV: @pytest.fixture async def oav_beam_centre_pv_fs() -> OAVBeamCentrePV: - oav_config = OAVConfig(TEST_OAV_ZOOM_LEVELS_XML) + oav_config = OAVConfig(TEST_OAV_ZOOM_LEVELS) async with init_devices(mock=True, connect=True): oav = OAVBeamCentrePV( "", config=oav_config, name="oav", mjpeg_prefix="XTAL", overlay_channel=3 diff --git a/tests/devices/oav/test_data/__init__.py b/tests/devices/oav/test_data/__init__.py index 204c5af0f2e..3411c4666cc 100644 --- a/tests/devices/oav/test_data/__init__.py +++ b/tests/devices/oav/test_data/__init__.py @@ -2,7 +2,7 @@ from pathlib import Path TEST_DATA_PATH = Path(__file__).parent -TEST_OAV_CENTRING_JSON = join(TEST_DATA_PATH, "test_OAVCentring.json") +TEST_OAV_CENTRING_JSON = "test_OAVCentring.json" OAV_SNAPSHOT_TEST_PNG = join(TEST_DATA_PATH, "oav_snapshot_test.png") OAV_SNAPSHOT_EXPECTED_PNG = join(TEST_DATA_PATH, "oav_snapshot_expected.png") diff --git a/tests/devices/oav/test_data/test_OAVCentring.json b/tests/devices/oav/test_data/test_OAVCentring.json deleted file mode 100644 index d4002b0eff1..00000000000 --- a/tests/devices/oav/test_data/test_OAVCentring.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "exposure": 0.075, - "acqPeriod": 0.05, - "gain": 1.0, - "minheight": 70, - "oav": "OAV", - "mxsc_input": "CAM", - "min_callback_time": 0.080, - "close_ksize": 11, - "direction": 0, - "pinTipCentring": { - "zoom": 1.0, - "preprocess": 8, - "preProcessKSize": 21, - "CannyEdgeUpperThreshold": 20.0, - "CannyEdgeLowerThreshold": 5.0, - "brightness": 20, - "max_tip_distance": 300, - "mxsc_input": "proc", - "minheight": 10, - "min_callback_time": 0.15, - "filename": "/dls_sw/prod/R3.14.12.7/support/adPython/2-1-11/adPythonApp/scripts/adPythonMxSampleDetect.py" - }, - "loopCentring": { - "zoom": 5.0, - "preprocess": 8, - "preProcessKSize": 21, - "CannyEdgeUpperThreshold": 20.0, - "CannyEdgeLowerThreshold": 5.0, - "brightness": 20, - "filename": "/dls_sw/prod/R3.14.12.7/support/adPython/2-1-11/adPythonApp/scripts/adPythonMxSampleDetect.py", - "max_tip_distance": 300, - "minheight": 10 - }, - "xrayCentring": { - "zoom": 7.5, - "preprocess": 8, - "preProcessKSize": 31, - "CannyEdgeUpperThreshold": 30.0, - "CannyEdgeLowerThreshold": 5.0, - "close_ksize": 3, - "filename": "/dls_sw/prod/R3.14.12.7/support/adPython/2-1-11/adPythonApp/scripts/adPythonMxSampleDetect.py", - "brightness": 80 - }, - "rotationAxisAlign": { - "zoom": 10.0, - "preprocess": 8, - "preProcessKSize": 21, - "CannyEdgeUpperThreshold": 20.0, - "CannyEdgeLowerThreshold": 5.0, - "filename": "/dls_sw/prod/R3.14.12.7/support/adPython/2-1-11/adPythonApp/scripts/adPythonMxSampleDetect.py", - "brightness": 100 - }, - "SmargonOffsets1": { - "zoom": 1.0, - "preprocess": 8, - "preProcessKSize": 21, - "CannyEdgeUpperThreshold": 50.0, - "CannyEdgeLowerThreshold": 5.0, - "brightness": 80 - }, - "SmargonOffsets2": { - "zoom": 5.0, - "preprocess": 8, - "preProcessKSize": 11, - "CannyEdgeUpperThreshold": 50.0, - "CannyEdgeLowerThreshold": 5.0, - "brightness": 90 - } -} diff --git a/tests/devices/oav/test_oav.py b/tests/devices/oav/test_oav.py index 93e340cd645..469b876f922 100644 --- a/tests/devices/oav/test_oav.py +++ b/tests/devices/oav/test_oav.py @@ -14,7 +14,7 @@ ) from tests.test_data import ( TEST_DISPLAY_CONFIG, - TEST_OAV_ZOOM_LEVELS_XML, + TEST_OAV_ZOOM_LEVELS, ) @@ -167,7 +167,7 @@ async def test_beam_centre_signals_have_same_names( async def test_oav_with_null_zoom_controller(null_controller: NullZoomController): - oav_config = OAVConfigBeamCentre(TEST_OAV_ZOOM_LEVELS_XML, TEST_DISPLAY_CONFIG) + oav_config = OAVConfigBeamCentre(TEST_OAV_ZOOM_LEVELS, TEST_DISPLAY_CONFIG) oav = OAVBeamCentreFile("", oav_config, "", zoom_controller=null_controller) assert await oav.zoom_controller.level.get_value() == "1.0x" @@ -193,7 +193,7 @@ async def test_oav_with_null_zoom_controller_set_zoom_level_other_than_1( ["MJPG", "XTAL"], ) async def test_setting_mjpeg_prefix_changes_stream_url(mjpeg_prefix): - oav_config = OAVConfigBeamCentre(TEST_OAV_ZOOM_LEVELS_XML, TEST_DISPLAY_CONFIG) + oav_config = OAVConfigBeamCentre(TEST_OAV_ZOOM_LEVELS, TEST_DISPLAY_CONFIG) async with init_devices(mock=True, connect=True): oav = OAVBeamCentreFile( "", config=oav_config, name="oav", mjpeg_prefix=mjpeg_prefix diff --git a/tests/devices/oav/test_oav_parameters.py b/tests/devices/oav/test_oav_parameters.py index ee856c1d784..7be33590e6e 100644 --- a/tests/devices/oav/test_oav_parameters.py +++ b/tests/devices/oav/test_oav_parameters.py @@ -12,7 +12,7 @@ from tests.devices.oav.test_data import TEST_OAV_CENTRING_JSON from tests.test_data import ( TEST_DISPLAY_CONFIG, - TEST_OAV_ZOOM_LEVELS_XML, + TEST_OAV_ZOOM_LEVELS, ) @@ -26,13 +26,13 @@ def mock_parameters(): @pytest.fixture def mock_config() -> dict[str, ZoomParams]: - return OAVConfig(TEST_OAV_ZOOM_LEVELS_XML).get_parameters() + return OAVConfig(TEST_OAV_ZOOM_LEVELS).get_parameters() @pytest.fixture def mock_config_with_beam_centre() -> dict[str, ZoomParamsCrosshair]: config = OAVConfigBeamCentre( - TEST_OAV_ZOOM_LEVELS_XML, TEST_DISPLAY_CONFIG + TEST_OAV_ZOOM_LEVELS, TEST_DISPLAY_CONFIG ).get_parameters() config = cast(dict[str, ZoomParamsCrosshair], config) return config diff --git a/tests/test_data/__init__.py b/tests/test_data/__init__.py index 2b2948e8f65..a4650faa744 100644 --- a/tests/test_data/__init__.py +++ b/tests/test_data/__init__.py @@ -5,13 +5,13 @@ BAD_BEAMLINE_PARAMETERS = join(TEST_DATA_PATH, "bad_beamlineParameters") I04_BEAMLINE_PARAMETERS = join(TEST_DATA_PATH, "i04_beamlineParameters") TEST_BEAMLINE_PARAMETERS_TXT = join(TEST_DATA_PATH, "test_beamline_parameters.txt") -TEST_DISPLAY_CONFIG = join(TEST_DATA_PATH, "test_display.configuration") -TEST_OAV_ZOOM_LEVELS_XML = join(TEST_DATA_PATH, "test_oav_zoom_levels.xml") +TEST_DISPLAY_CONFIG = "test_display.configuration" +TEST_OAV_ZOOM_LEVELS = "jCameraManZoomLevels.xml" __all__ = [ "BAD_BEAMLINE_PARAMETERS", "I04_BEAMLINE_PARAMETERS", "TEST_BEAMLINE_PARAMETERS_TXT", "TEST_DISPLAY_CONFIG", - "TEST_OAV_ZOOM_LEVELS_XML", + "TEST_OAV_ZOOM_LEVELS", ] diff --git a/tests/test_data/test_display.configuration b/tests/test_data/test_display.configuration deleted file mode 100644 index dfb01954ac9..00000000000 --- a/tests/test_data/test_display.configuration +++ /dev/null @@ -1,42 +0,0 @@ -zoomLevel = 1.0 -crosshairX = 477 -crosshairY = 359 -topLeftX = 383 -topLeftY = 253 -bottomRightX = 410 -bottomRightY = 278 -zoomLevel = 2.5 -crosshairX = 493 -crosshairY = 355 -topLeftX = 340 -topLeftY = 283 -bottomRightX = 388 -bottomRightY = 322 -zoomLevel = 5.0 -crosshairX = 517 -crosshairY = 350 -topLeftX = 268 -topLeftY = 326 -bottomRightX = 354 -bottomRightY = 387 -zoomLevel = 7.5 -crosshairX = 549 -crosshairY = 347 -topLeftX = 248 -topLeftY = 394 -bottomRightX = 377 -bottomRightY = 507 -zoomLevel = 10.0 -crosshairX = 613 -crosshairY = 344 -topLeftX = 2 -topLeftY = 489 -bottomRightX = 206 -bottomRightY = 630 -zoomLevel = 15.0 -crosshairX = 693 -crosshairY = 339 -topLeftX = 1 -topLeftY = 601 -bottomRightX = 65 -bottomRightY = 767 diff --git a/tests/test_data/test_oav_zoom_levels.xml b/tests/test_data/test_oav_zoom_levels.xml deleted file mode 100644 index d751fd69747..00000000000 --- a/tests/test_data/test_oav_zoom_levels.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - 1.0 - 0 - 2.87 - 2.87 - - - 2.5 - 10 - 2.31 - 2.31 - - - 5.0 - 25 - 1.58 - 1.58 - - - 7.5 - 50 - 0.806 - 0.806 - - - 10.0 - 75 - 0.438 - 0.438 - - - 15.0 - 90 - 0.302 - 0.302 - - -1.0 -