One of the most frequent complaints I'm getting from students is that clock loses sync and then raises an error during long runs. For instance, they may want to schedule several long runs overnight, but clock loses sync 20 minutes into the run. This can be very frustrating, especially if the overrun is not very large.
I suggest a flag which allows for overruns and returns the difference in time steps between this and the next time step so that users can handle this correctly in their code, something like:
for dt, t in clock(1000, overrun=True):
# use dt to for instance do integration calculations correctly.
One of the most frequent complaints I'm getting from students is that
clock
loses sync and then raises an error during long runs. For instance, they may want to schedule several long runs overnight, but clock loses sync 20 minutes into the run. This can be very frustrating, especially if the overrun is not very large.I suggest a flag which allows for overruns and returns the difference in time steps between this and the next time step so that users can handle this correctly in their code, something like: