Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/dodal/beamlines/i03.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def daq_configuration_path() -> str:

@devices.factory()
def aperture_scatterguard(config_client: ConfigClient) -> ApertureScatterguard:
print(BEAMLINE_PARAMETERS_PATH)
params = config_client.get_file_contents(BEAMLINE_PARAMETERS_PATH, dict)
return ApertureScatterguard(
aperture_prefix=f"{PREFIX.beamline_prefix}-MO-MAPT-01:",
Expand Down
8 changes: 4 additions & 4 deletions src/dodal/devices/oav/oav_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ class OAVParameters:

def __init__(
self,
config_client: ConfigClient,
context="loopCentring",
oav_config_json=OAV_CONFIG_JSON,
):
self.oav_config_json: str = oav_config_json
self.context = context
config_server = ConfigClient(url="https://daq-config.diamond.ac.uk")

self.global_params, self.context_dicts = self.load_json(
config_server, self.oav_config_json
config_client, self.oav_config_json
)
self.active_params: ChainMap = ChainMap(
self.context_dicts[self.context], self.global_params
Expand All @@ -47,12 +47,12 @@ def __init__(

@staticmethod
def load_json(
config_server: ConfigClient, filename: str
config_client: ConfigClient, filename: str
) -> tuple[dict[str, Any], dict[str, dict]]:
"""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.
"""
raw_params: dict[str, Any] = config_server.get_file_contents(filename, dict)
raw_params: dict[str, Any] = config_client.get_file_contents(filename, dict)
global_params = {
k: raw_params.pop(k)
for k, v in list(raw_params.items())
Expand Down
5 changes: 1 addition & 4 deletions tests/devices/oav/test_oav_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@

@pytest.fixture
def mock_parameters():
return OAVParameters(
"loopCentring",
TEST_OAV_CENTRING_JSON,
)
return OAVParameters(ConfigClient(""), "loopCentring", TEST_OAV_CENTRING_JSON)


@pytest.fixture
Expand Down
3 changes: 2 additions & 1 deletion tests/plans/device_setup_plans/test_setup_pin_tip.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
from bluesky import RunEngine
from daq_config_server import ConfigClient
from ophyd_async.core import init_devices

from dodal.devices.oav.oav_parameters import OAVParameters
Expand All @@ -20,7 +21,7 @@ def pin_tip_detection() -> PinTipDetection:

@pytest.fixture
def params() -> OAVParameters:
return OAVParameters("pinTipCentring", TEST_OAV_CENTRING_JSON)
return OAVParameters(ConfigClient(""), "pinTipCentring", TEST_OAV_CENTRING_JSON)


@pytest.mark.parametrize(
Expand Down
Loading