diff --git a/docs/how-to/add-plans-and-devices.md b/docs/how-to/add-plans-and-devices.md index a2c12e0b2..5f29865f9 100644 --- a/docs/how-to/add-plans-and-devices.md +++ b/docs/how-to/add-plans-and-devices.md @@ -27,7 +27,7 @@ Plans in Python files look like this: > **_NOTE:_** The type annotations (e.g. `: str`, `: int`, `-> MsgGenerator`) are required as blueapi uses them to generate an API! You can define as many plans as you like in a single Python file or spread them over multiple files. ``` from bluesky.protocols import Readable, Movable - from blueapi.core import MsgGenerator + from dodal.common import MsgGenerator from typing import Mapping, Any def my_plan( diff --git a/src/blueapi/core/__init__.py b/src/blueapi/core/__init__.py index 7b2306b0f..d7c352a74 100644 --- a/src/blueapi/core/__init__.py +++ b/src/blueapi/core/__init__.py @@ -3,9 +3,7 @@ BLUESKY_PROTOCOLS, DataEvent, Device, - MsgGenerator, Plan, - PlanGenerator, WatchableStatus, is_bluesky_compatible_device, is_bluesky_compatible_device_type, @@ -16,8 +14,6 @@ __all__ = [ "Plan", - "PlanGenerator", - "MsgGenerator", "Device", "BLUESKY_PROTOCOLS", "BlueskyContext", diff --git a/src/blueapi/core/context.py b/src/blueapi/core/context.py index 429ef4d77..ad8ac11b8 100644 --- a/src/blueapi/core/context.py +++ b/src/blueapi/core/context.py @@ -15,6 +15,7 @@ ) from bluesky.run_engine import RunEngine +from dodal.common import PlanGenerator from dodal.utils import make_all_devices from ophyd_async.core import NotConnected from pydantic import GetCoreSchemaHandler, GetJsonSchemaHandler, create_model @@ -30,7 +31,6 @@ Device, HasName, Plan, - PlanGenerator, is_bluesky_compatible_device, is_bluesky_plan_generator, ) diff --git a/src/blueapi/utils/__init__.py b/src/blueapi/utils/__init__.py index b871f842a..c81762542 100644 --- a/src/blueapi/utils/__init__.py +++ b/src/blueapi/utils/__init__.py @@ -7,7 +7,6 @@ __all__ = [ "handle_all_exceptions", "load_module_all", - "ConfigLoader", "serialize", "BlueapiBaseModel", "BlueapiModelConfig", diff --git a/tests/unit_tests/core/test_context.py b/tests/unit_tests/core/test_context.py index c7b1ad8ef..af17e33b3 100644 --- a/tests/unit_tests/core/test_context.py +++ b/tests/unit_tests/core/test_context.py @@ -5,7 +5,7 @@ import pytest from bluesky.protocols import Descriptor, Movable, Readable, Reading, SyncOrAsync -from dls_bluesky_core.core import MsgGenerator, PlanGenerator, inject +from dodal.common import MsgGenerator, PlanGenerator, inject from ophyd.sim import SynAxis, SynGauss from pydantic import TypeAdapter, ValidationError from pytest import LogCaptureFixture diff --git a/tests/unit_tests/service/test_interface.py b/tests/unit_tests/service/test_interface.py index 86dd2e5c1..257181c3a 100644 --- a/tests/unit_tests/service/test_interface.py +++ b/tests/unit_tests/service/test_interface.py @@ -4,11 +4,11 @@ import pytest from bluesky_stomp.messaging import StompClient +from dodal.common import MsgGenerator from ophyd.sim import SynAxis from stomp.connect import StompConnection11 as Connection from blueapi.config import ApplicationConfig, StompConfig -from blueapi.core import MsgGenerator from blueapi.core.context import BlueskyContext from blueapi.service import interface from blueapi.service.model import DeviceModel, PlanModel, WorkerTask @@ -148,7 +148,7 @@ def test_get_device(context_mock: MagicMock): ) with pytest.raises(KeyError): - assert interface.get_device("non_existing_device") + interface.get_device("non_existing_device") @patch("blueapi.service.interface.context") diff --git a/tests/unit_tests/worker/test_task_worker.py b/tests/unit_tests/worker/test_task_worker.py index 96777db9b..ecd76019c 100644 --- a/tests/unit_tests/worker/test_task_worker.py +++ b/tests/unit_tests/worker/test_task_worker.py @@ -7,9 +7,10 @@ from unittest.mock import MagicMock, patch import pytest +from dodal.common import MsgGenerator from blueapi.config import EnvironmentConfig, Source, SourceKind -from blueapi.core import BlueskyContext, EventStream, MsgGenerator +from blueapi.core import BlueskyContext, EventStream from blueapi.core.bluesky_types import DataEvent from blueapi.worker import ( ProgressEvent,