bluesky.plan_stubs.repeat#
- bluesky.plan_stubs.repeat(plan: Callable[[], Generator[Msg, Any, P]], num: int | None = 1, delay: float | Iterable[float] = 0.0, *, delay_after_completion: bool = False) Generator[Msg, Any, Any][source]#
Repeat a plan num times with delay and checkpoint between each repeat.
This is different from
repeaterandcaching_repeaterin that it addscheckpointand optionallysleepmessages if delay is provided. This is intended for users who need the structure ofcountbut do not want to reimplement the control flow.- Parameters:
- plan: callable
Callable that returns an iterable of Msg objects
- numinteger, optional
number of readings to take; default is 1
If None, capture data until canceled
- delayiterable or scalar, optional
time delay between successive readings; default is 0
- delay_after_completionbool, optional
If False (default),
delayis the time from the start of one repetition to the start of the next, so the time each repetition takes is subtracted from it. If True, the fulldelayis slept after each repetition, regardless of how long it took.
- Returns:
- anyoutput of original plan
- Yields:
- msgMsg
Notes
If
delayis an iterable, it must have at leastnum - 1entries or the plan will raise aValueErrorduring iteration.