Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
callumforrester committed May 31, 2024
1 parent f5b4c7d commit b4b3225
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/blueapi/core/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ def with_dodal_module(self, module: ModuleType, **kwargs) -> None:
for device in devices.values():
self.device(device)

directory_provider = get_directory_provider()
if directory_provider is not None:
self.run_engine.scan_id_source = (
lambda _: directory_provider.next_scan_number
)

# If exceptions have occurred, we log them but we do not make blueapi
# fall over
if len(exceptions) > 0:
Expand All @@ -123,6 +117,14 @@ def with_dodal_module(self, module: ModuleType, **kwargs) -> None:
)
LOGGER.exception(NotConnected(exceptions))

def with_dodal_directory_provider(self) -> None:
directory_provider = get_directory_provider()
if directory_provider is not None:
directory_provider.scan_id_source = lambda _: self.run_engine.md["scan_id"]

Check warning on line 123 in src/blueapi/core/context.py

View check run for this annotation

Codecov / codecov/patch

src/blueapi/core/context.py#L121-L123

Added lines #L121 - L123 were not covered by tests

def with_scan_id_source(self, source) -> None:
self.run_engine.scan_id_source = lambda _: source

Check warning on line 126 in src/blueapi/core/context.py

View check run for this annotation

Codecov / codecov/patch

src/blueapi/core/context.py#L126

Added line #L126 was not covered by tests

def plan(self, plan: PlanGenerator) -> PlanGenerator:
"""
from dodal.beamlines.beamline_utils import get_directory_provider
Expand Down

0 comments on commit b4b3225

Please sign in to comment.