Timespan¶
-
class
lsst.daf.butler.
Timespan
¶ Bases:
tuple
A 2-element named tuple for time intervals.
Parameters: Attributes Summary
begin
Minimum timestamp in the interval (inclusive). end
Maximum timestamp in the interval (exclusive). Methods Summary
count
($self, value, /)Return number of occurrences of value. difference
(other)Return the one or two timespans that cover the interval(s) that are in self
but notother
.index
($self, value[, start, stop])Return first index of value. intersection
()Return a new Timespan
that is contained by all of the given ones.overlaps
(other)Test whether this timespan overlaps another. Attributes Documentation
Methods Documentation
-
count
($self, value, /)¶ Return number of occurrences of value.
-
difference
(other: lsst.daf.butler.core.timespan.Timespan) → Iterator[lsst.daf.butler.core.timespan.Timespan]¶ Return the one or two timespans that cover the interval(s) that are in
self
but notother
.This is implemented as an iterator because the result may be zero, one, or two
Timespan
objects, depending on the relationship between the operands.Parameters: - other :
Timespan
Timespan to subtract.
Yields: - other :
-
index
($self, value, start=0, stop=sys.maxsize, /)¶ Return first index of value.
Raises ValueError if the value is not present.
-
intersection
() → Optional[lsst.daf.butler.core.timespan.Timespan]¶ Return a new
Timespan
that is contained by all of the given ones.Parameters: - *args
All positional arguments are
Timespan
instances.
Returns:
-
overlaps
(other: lsst.daf.butler.core.timespan.Timespan) → Any¶ Test whether this timespan overlaps another.
Parameters: - other :
Timespan
Another timespan whose begin and end values can be compared with those of
self
with the>=
operator, yielding values that can be passed toops.or_
and/orops.and_
.
Returns: - other :
-