Skip to content

Commit

Permalink
Update example code to be correct
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicOram authored Jul 24, 2023
1 parent 14d1bc0 commit eca21f2
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions docs/developer/explanations/lifecycle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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
------------------------

Expand Down

0 comments on commit eca21f2

Please sign in to comment.