Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example code to be correct #277

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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