Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
Use blueapi with_dodal_module
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Willemsen committed Oct 12, 2023
1 parent 4b7c342 commit 592cef7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package_dir =
install_requires =
bluesky
pyepics
blueapi @ git+https://github.com/Tom-Willemsen/blueapi@unpin_dodal
blueapi @ git+https://github.com/DiamondLightSource/blueapi@main
flask-restful
zocalo
ispyb
Expand All @@ -36,7 +36,7 @@ install_requires =
xarray
doct
databroker
dodal @ git+https://github.com/DiamondLightSource/python-dodal.git@af63f5cf6742e094faac298396e2c16b422bcc8e
dls-dodal
pydantic<2.0 # See https://github.com/DiamondLightSource/hyperion/issues/774


Expand Down
10 changes: 3 additions & 7 deletions src/hyperion/utils/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# away once we fully use blueapi's plan management components.
# https://github.com/DiamondLightSource/hyperion/issues/868
from dodal.beamlines.beamline_utils import _wait_for_connection
from dodal.utils import get_beamline_based_on_environment_variable, make_all_devices
from dodal.utils import get_beamline_based_on_environment_variable

import hyperion.experiment_plans as hyperion_plans
from hyperion.log import LOGGER
Expand Down Expand Up @@ -78,14 +78,10 @@ def setup_context(
context = BlueskyContext()
context.with_plan_module(hyperion_plans)

# Ideally would use context.with_dodal_module, but it doesn't support
# passing through wait_for_connection or fake_with_ophyd_sim
# See https://github.com/DiamondLightSource/blueapi/pull/304
for name, device in make_all_devices(
context.with_dodal_module(
get_beamline_based_on_environment_variable(),
wait_for_connection=wait_for_connection,
fake_with_ophyd_sim=fake_with_ophyd_sim,
).items():
context.device(device, name=name)
)

return context

0 comments on commit 592cef7

Please sign in to comment.