diff --git a/src/dodal/common/coordination.py b/src/dodal/common/coordination.py index e04edefc21..5cf61a1c10 100644 --- a/src/dodal/common/coordination.py +++ b/src/dodal/common/coordination.py @@ -1,4 +1,6 @@ import uuid +import warnings +from textwrap import dedent from typing import Any from dodal.common.types import Group @@ -37,4 +39,20 @@ def scan(x: Movable = inject("stage_x"), start: float = 0.0 ...) """ + warnings.warn( + dedent(""" + Inject is deprecated, users are now expected to call the device factory + functions in dodal directly, these will cache devices as singletons after + they have been called once. For example: + + import i22 + + + def my_plan(detector: Readable = i22.saxs()) -> MsgGenerator: + ... + + Where previously the default would have been inject("saxs") + """), + DeprecationWarning, + stacklevel=2, + ) return name