Skip to content

Commit

Permalink
Merge pull request DiamondLightSource/hyperion#1352 from DiamondLight…
Browse files Browse the repository at this point in the history
…Source/dirProvider

 Convert UDCDirectoryProvider to standard pattern
  • Loading branch information
olliesilvester authored May 9, 2024
2 parents 6e07e64 + 29ac9a9 commit a69222e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ install_requires =
xarray
doct
databroker
dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@890027c1bcd95f8fe35576630e320b97b7959006
dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@9a49a27234602d44ed8cffb130b6b39c4faefb5c
pydantic<2.0 # See https://github.com/DiamondLightSource/hyperion/issues/774
scipy
pyzmq<25 # See https://github.com/DiamondLightSource/hyperion/issues/1103
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import bluesky.preprocessors as bpp
import numpy as np
from blueapi.core import BlueskyContext, MsgGenerator
from dodal.common import udc_directory_provider
from dodal.beamlines.beamline_utils import get_directory_provider
from dodal.devices.panda_fast_grid_scan import (
set_fast_grid_scan_params as set_flyscan_params,
)
Expand Down Expand Up @@ -196,8 +196,8 @@ def run_gridscan_and_move(
time_between_x_steps_ms,
)

udc_directory_provider.set_directory(
Path(parameters.hyperion_params.detector_params.directory)
get_directory_provider().update(
directory=Path(parameters.hyperion_params.detector_params.directory)
)
yield from setup_panda_for_flyscan(
fgs_composite.panda,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,12 @@ def wrapped_run_gridscan_and_move():
new=MagicMock(return_value=iter([])),
)
@patch(
"hyperion.experiment_plans.panda_flyscan_xray_centre_plan.udc_directory_provider.set_directory",
"hyperion.experiment_plans.panda_flyscan_xray_centre_plan.get_directory_provider",
autospec=True,
)
def test_when_gridscan_run_panda_directory_applied(
self,
set_directory,
get_directory_provider,
RE_with_subs: tuple[RunEngine, Any],
test_panda_fgs_params: PandAGridscanInternalParameters,
fake_fgs_composite: FlyScanXRayCentreComposite,
Expand All @@ -500,7 +500,7 @@ def test_when_gridscan_run_panda_directory_applied(
run_gridscan_and_move(fake_fgs_composite, test_panda_fgs_params)
)
expected_path = Path("/dls/i03/data/2023/cm33866-5/test_hyperion")
set_directory.assert_called_once_with(expected_path)
get_directory_provider().update.assert_called_once_with(directory=expected_path)

@patch(
"hyperion.experiment_plans.panda_flyscan_xray_centre_plan.run_gridscan",
Expand Down

0 comments on commit a69222e

Please sign in to comment.