From fe8c91aaa34471301d8a0eb5c792cbfcafc7adfd Mon Sep 17 00:00:00 2001 From: Robert Tuck Date: Mon, 20 Oct 2025 12:07:26 +0100 Subject: [PATCH] Make inject argument optional --- src/dodal/common/coordination.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dodal/common/coordination.py b/src/dodal/common/coordination.py index e04edefc21f..e04fdfc0557 100644 --- a/src/dodal/common/coordination.py +++ b/src/dodal/common/coordination.py @@ -17,7 +17,7 @@ def group_uuid(name: str) -> Group: return f"{name}-{str(uuid.uuid4())[:6]}" -def inject(name: str) -> Any: # type: ignore +def inject(name: str = "") -> Any: # type: ignore """ Function to mark a defaulted argument of a plan as a reference to a device stored in another context and not available to be referenced directly. @@ -30,7 +30,8 @@ def inject(name: str) -> Any: # type: ignore def scan(x: Movable = inject("stage_x"), start: float = 0.0 ...) Args: - name (str): Name of a Device to be fetched from an external context + name (str): Name of a Device to be fetched from an external context. This can be + left blank when injecting device composites (the default) Returns: Any: name but without typing checking, valid as any default type