timing

Contains utility functions for defining and discretizing times.

Functions

to_time(value)

Converts a value to a Time object.

to_time_bounds(durations)

Converts an iterable of durations to an iterable of Time objects.

get_step_bounds(step_durations)

Returns the time at which each step starts from their durations.

start_tick(start_time, time_step)

Returns the included first tick index of the step starting at start_time.

stop_tick(stop_time, time_step)

Returns the excluded last tick index of the step ending at stop_time.

number_ticks(start_time, stop_time, time_step)

Returns the number of ticks between start_time and stop_time.