diff --git a/helm/blueapi/values.yaml b/helm/blueapi/values.yaml index a38c3eb39..e4486e105 100644 --- a/helm/blueapi/values.yaml +++ b/helm/blueapi/values.yaml @@ -91,9 +91,9 @@ worker: env: sources: - kind: deviceFunctions - module: blueapi.startup.example_devices + module: blueapi.startup - kind: planFunctions - module: blueapi.startup.example_plans + module: blueapi.startup stomp: auth: username: guest diff --git a/src/blueapi/config.py b/src/blueapi/config.py index a6345f71f..83054a3f8 100644 --- a/src/blueapi/config.py +++ b/src/blueapi/config.py @@ -47,10 +47,8 @@ class EnvironmentConfig(BlueapiBaseModel): """ sources: list[Source] = [ - Source( - kind=SourceKind.DEVICE_FUNCTIONS, module="blueapi.startup.example_devices" - ), - Source(kind=SourceKind.PLAN_FUNCTIONS, module="blueapi.startup.example_plans"), + Source(kind=SourceKind.DEVICE_FUNCTIONS, module="blueapi.startup"), + Source(kind=SourceKind.PLAN_FUNCTIONS, module="blueapi.startup"), ] events: WorkerEventConfig = Field(default_factory=WorkerEventConfig) diff --git a/src/blueapi/startup/__init__.py b/src/blueapi/startup/__init__.py index e69de29bb..8a5c5733e 100644 --- a/src/blueapi/startup/__init__.py +++ b/src/blueapi/startup/__init__.py @@ -0,0 +1,27 @@ +from .example_devices import ( + current_det, + image_det, + sample_pressure, + sample_temperature, + theta, + unplugged_motor, + x, + x_err, + y, + z, +) +from .example_plans import scan + +__all__ = [ + "x", + "y", + "z", + "theta", + "current_det", + "image_det", + "sample_pressure", + "sample_temperature", + "unplugged_motor", + "x_err", + "scan", +] diff --git a/src/blueapi/startup/example_plans.py b/src/blueapi/startup/example_plans.py index 1b08d9272..bb23b8991 100644 --- a/src/blueapi/startup/example_plans.py +++ b/src/blueapi/startup/example_plans.py @@ -4,7 +4,7 @@ from typing import Annotated, Any import bluesky.plans as bp -from bluesky.protocols import Movable, Readable +from bluesky.protocols import HasName, Movable, Readable from cycler import Cycler, cycler from dodal.common import MsgGenerator from dodal.plans.data_session_metadata import attach_data_session_metadata_decorator @@ -18,6 +18,9 @@ """ +class NamedMovable(HasName, Movable): ... + + @attach_data_session_metadata_decorator() @validate_call(config={"arbitrary_types_allowed": True}) def scan( @@ -25,7 +28,7 @@ def scan( set[Readable], "Set of readable devices, will take a reading at each point" ], axes_to_move: Annotated[ - Mapping[str, Movable], "All axes involved in this scan, names and objects" + Mapping[str, NamedMovable], "All axes involved in this scan, names and objects" ], spec: Annotated[Spec[str], "ScanSpec modelling the path of the scan"], metadata: Mapping[str, Any] | None = None,