Timespan¶
-
class
lsst.daf.butler.
Timespan
¶ Bases:
lsst.daf.butler.core.timespan.BaseTimespan
A generic 2-element named tuple for time intervals.
Timespan
explicitly marks both its start and end bounds as possiblyNone
(signifying infinite bounds), and provides operations that take that into account.Attributes Summary
begin
Minimum timestamp in the interval (inclusive). end
Maximum timestamp in the interval (inclusive). Methods Summary
count
($self, value, /)Return number of occurrences of value. 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, ops)Test whether this timespan overlaps another. Attributes Documentation
Methods Documentation
-
count
($self, value, /)¶ Return number of occurrences of value.
-
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: Notes
Unlike
overlaps
, this method does not support SQLAlchemy column expressions as operands.
-
overlaps
(other: lsst.daf.butler.core.timespan.Timespan[typing.Any][Any], ops: Any = <module 'operator' from '/opt/lsst/software/stack/conda/miniconda3-py37_4.8.2/envs/lsst-scipipe-cb4e2dc/lib/python3.7/operator.py'>) → 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_
.- ops :
Any
, optional Any object with
and_
andor_
boolean operators. Defaults to the Python built-inoperator
module, which is appropriate whenT
is a Python literal likeastropy.time.Time
. When either operand contains SQLAlchemy column expressions, thesqlalchemy.sql
module should be used instead.
Returns: - other :
-