experanto.intervals.TimeInterval

class TimeInterval(start, end)[source]

Bases: NamedTuple

A time interval represented by start and end times.

Parameters:
  • start (float) – Start time in seconds.

  • end (float) – End time in seconds.

Examples

>>> interval = TimeInterval(0.0, 10.0)
>>> 5.0 in interval
True
>>> 15.0 in interval
False

Methods

__init__()

count(value, /)

Return number of occurrences of value.

find_intersection_between_two_intervals(...)

index(value[, start, stop])

Return first index of value.

intersect(times)

Attributes

end

Alias for field number 1

start

Alias for field number 0

start: float

Alias for field number 0

end: float

Alias for field number 1

find_intersection_between_two_intervals(other_interval)[source]
intersect(times)[source]
count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.