coordinates.mixins.mathops.CoordinateSystemMathMixin.requires_expression#
- CoordinateSystemMathMixin.requires_expression(value: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None, expression: str, coordinates: Sequence[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]], fixed_axes: Dict[str, float] | None = None) _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] [source]#
Return value if not None; otherwise evaluate compute_expression.
This is a convenience method for lazy evaluation over ND broadcasted grids.
- Parameters:
value (
array-like
orNone
) – Precomputed result or None to trigger evaluation.expression (
str
) – The name of the expression to evaluate if value is None.coordinates (
list
ofarray-like
) – ND broadcasted coordinate arrays.fixed_axes (
dict
of{str: float}
, optional) – Scalar axes for fixed dimensions.
- Returns:
Either the provided value or the computed result.
- Return type:
array-like