def _do_step(self, wait_on=None): if self._aborted: return if self._intersteps: for i in self._intersteps: i.on_next_step_starting(self) self._intersteps = () self._barriers = [] try: finished, retval = self._stepper.step() except _PropagateReturn: finished, retval = True, None # Could have aborted during the step if self._aborted: return if not finished: if retval is not None: if isinstance(retval, tuple): self._intersteps = retval elif isinstance(retval, Interstep): self._intersteps = (retval,) else: raise TypeError( "Invalid value returned from step '{}'".format(retval)) for i in self._intersteps: i.on_last_step_finished(self) if self._barriers: return WaitOnAll(self._do_step.__name__, self._barriers) else: return Checkpoint(self._do_step.__name__)
def _do_step(self, wait_on=None): finished, retval = self._stepper.step() if not finished: if isinstance(retval, ResultToContext): return _ResultToContext(self._do_step.__name__, **retval.to_assign) else: return Checkpoint(self._do_step.__name__)
def _do_step(self, wait_on=None): if self._intersteps: for i in self._intersteps: i.on_next_step_starting(self) self._intersteps = None self._barriers = [] finished, retval = self._stepper.step() if not finished: if retval is not None: if isinstance(retval, tuple): self._intersteps = retval elif isinstance(retval, Interstep): self._intersteps = (retval, ) else: raise TypeError( "Invalid value returned from step '{}'".format(retval)) for i in self._intersteps: i.on_last_step_finished(self) if self._barriers: return WaitOnAll(self._do_step.__name__, self._barriers) else: return Checkpoint(self._do_step.__name__)
def _run(self): return Checkpoint(), self.finish
def middle_step(self, wait_on): return Checkpoint(), None
def _run(self): self.out("test", 5) return Checkpoint(), self.middle_step
def middle_step(self, wait_on): return Checkpoint(), self.finish