diff --git a/docs/developer/explanations/lifecycle.rst b/docs/developer/explanations/lifecycle.rst index 53ddfd704..a28004ee1 100644 --- a/docs/developer/explanations/lifecycle.rst +++ b/docs/developer/explanations/lifecycle.rst @@ -6,12 +6,13 @@ of being written, loaded and run. Take the following plan. .. code:: python - from typing import List, Union, Mapping, Any - - from blueapi.core import inject, Plan + from typing import Any, List, Mapping, Optional, Union + + import bluesky.plans as bp + from blueapi.core import MsgGenerator, inject from bluesky.protocols import Readable - from ophyd import Component - + + def count( detectors: List[Readable] = [inject("det")], # default valid for Blueapi only num: int = 1, @@ -20,7 +21,7 @@ of being written, loaded and run. Take the following plan. ) -> MsgGenerator: """ Take `n` readings from a collection of detectors - + Args: detectors (List[Readable]): Readable devices to read: when being run in Blueapi defaults to fetching a device named "det" from its @@ -31,17 +32,18 @@ of being written, loaded and run. Take the following plan. metadata (Optional[Mapping[str, Any]], optional): Key-value metadata to include in exported data. Defaults to None. - + Returns: MsgGenerator: _description_ - + Yields: Iterator[MsgGenerator]: _description_ """ - + yield from bp.count(detectors, num, delay=delay, md=metadata) + Loading and Registration ------------------------