It should be possible to specify a time plan with no delay but some known duration of number of loops (e.g. time_plan=TIntervalDuration(interval=0, duration=3)) ... and it is possible to instantiate it... but when you iterate over it in an MDASequence, you'll get an error:
File ~/dev/self/useq-schema/src/useq/_time.py:72, in TimePlan.deltas(self)
70 def deltas(self) -> Iterator[datetime.timedelta]:
71 current = timedelta(0)
---> 72 for _ in range(self.loops): # type: ignore # TODO
73 yield current
74 current += self.interval
File ~/dev/self/useq-schema/src/useq/_time.py:145, in TIntervalDuration.loops(self)
143 @property
144 def loops(self) -> int:
--> 145 return self.duration // self.interval + 1
ZeroDivisionError: integer division or modulo by zero
For this to work, I think the consumer (such as MDARunner.run) might actually need to special case an MDASequence with a TIntervalDuration plan of interval 0... or we should add something to MDAEvent like a kill_time: a total duration after which the experiment should be stopped.
It should be possible to specify a time plan with no delay but some known duration of number of loops (e.g.
time_plan=TIntervalDuration(interval=0, duration=3)
) ... and it is possible to instantiate it... but when you iterate over it in an MDASequence, you'll get an error:For this to work, I think the consumer (such as
MDARunner.run
) might actually need to special case an MDASequence with aTIntervalDuration
plan of interval 0... or we should add something toMDAEvent
like akill_time
: a total duration after which the experiment should be stopped.