Timespan¶
-
class
lsst.daf.butler.Timespan¶ Bases:
lsst.daf.butler.core.timespan.BaseTimespanA generic 2-element named tuple for time intervals.
Timespanexplicitly marks both its start and end bounds as possiblyNone(signifying infinite bounds), and provides operations that take that into account.Attributes Summary
beginMinimum timestamp in the interval (inclusive). endMaximum 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 Timespanthat 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
Timespanthat is contained by all of the given ones.Parameters: - *args
All positional arguments are
Timespaninstances.
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
selfwith 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-inoperatormodule, which is appropriate whenTis a Python literal likeastropy.time.Time. When either operand contains SQLAlchemy column expressions, thesqlalchemy.sqlmodule should be used instead.
Returns: - other :
-