semantique.processor.operators.before_#
- semantique.processor.operators.before_(x, y, track_types=True, **kwargs)[source]#
Test if x comes before y.
This is a specific temporal relational operator meant to be evaluated with a temporal coordinate as left-hand side operand, and a
semantique.time_instant()
and/orsemantique.time_interval()
as right-hand side operand. It will evaluate if the specified temporal coordinate is earlier in time than the given time instant or the start of the given time interval.- Parameters:
x (
xarray.DataArray
) – Array containing the operands at the left-hand side of each expression, which should be temporal coordinates.y – Time instant or time interval to be used as the right-hand side of each expression. May also be another array with temporal coordinates. In the latter case, when evaluating the expression for a coordinate in array
x
the second operand is the temporal bounding box of all coordinates in arrayy
.track_types (
bool
) – Should the operator promote the value type of the output object, based on the value type of the input objects?**kwargs – Ignored.
- Returns:
xarray.DataArray
– An array with the same shape asx
containing the results of all evaluated expressions.
Note
The timezones of x and y are expected to be equal.
Note
When tracking value types, this operator uses the following type promotion manual, with the first layer of keys being the supported value types of
x
, the second layer of keys being the supported value types ofy
given the value type ofx
, and the corresponding value being the promoted value type of the output.{'datetime': {'datetime': 'binary'}}