4.7.3. pde.trackers.interrupts module¶
Module defining classes for time interrupts for trackers
The provided interrupt classes are:
class representing a list of interrupt times |
|
class representing equidistantly spaced time interrupts |
|
class representing logarithmically spaced time interrupts |
|
class representing time interrupts spaced equidistantly in real time |
- class ConstantInterrupts(dt=1, t_start=None)[source]¶
Bases:
InterruptsBase
class representing equidistantly spaced time interrupts
- Parameters
dt (float) – The duration between subsequent interrupts. This is measured in simulation time units.
t_start (float, optional) – The time after which the tracker becomes active. If omitted, the tracker starts recording right away. This argument can be used for an initial equilibration period during which no data is recorded.
- class FixedInterrupts(interrupts)[source]¶
Bases:
InterruptsBase
class representing a list of interrupt times
- class LogarithmicInterrupts(dt_initial=1, factor=1, t_start=None)[source]¶
Bases:
ConstantInterrupts
class representing logarithmically spaced time interrupts
- Parameters
dt_initial (float) – The initial duration between subsequent interrupts. This is measured in simulation time units.
factor (float) – The factor by which the time between interrupts is increased every time. Values larger than one lead to time interrupts that are increasingly further apart.
t_start (float, optional) – The time after which the tracker becomes active. If omitted, the tracker starts recording right away. This argument can be used for an initial equilibration period during which no data is recorded.
- class RealtimeInterrupts(duration, dt_initial=0.01)[source]¶
Bases:
ConstantInterrupts
class representing time interrupts spaced equidistantly in real time
This spacing is only achieved approximately and depends on the initial value set by dt_initial and the actual variation in computation speed.
- Parameters
duration (float or str) – The duration (in real seconds) that the interrupts should be spaced apart. The duration can also be given as a string, which is then parsed using the function
parse_duration()
.dt_initial (float) – The initial duration between subsequent interrupts. This is measured in simulation time units.
- interval_to_interrupts(data)[source]¶
create interrupt class from various data formats specifying time intervals
- Parameters
data (str or number or
InterruptsBase
) – Data determining the interrupt class. If this is aInterruptsBase
, it is simply returned, numbers implyConstantInterrupts
, a string is parsed as a time forRealtimeInterrupts
, and lists are interpreted asFixedInterrupts
.- Returns
An instance that represents the time intervals
- Return type