cf.wi

cf.wi(value0, value1, units=None, attr=None)[source]

Return a comparison object for a variable for being within a range.

x == cf.wi(a, b) is equivalent to x == cf.ge(a) & cf.le(b).

Parameters :
value0 : object

The lower bound of the range which a variable is to be compared with.

value1 : object

The upper bound of the range which a variable is to be compared with.

units : str or cf.Units, optional

If applicable, the units of value0 and value1. By default, the same units as the variable being tested are assumed.

Returns :
out : cf.Comparison

The comparison object.

See also

eq, ge, gt, ne, le, lt, set, wo

Examples

>>> c = cf.wi(5, 7)
>>> c
<CF Comparison: wi (5, 7)>
>>> c.evaluate(6)
True
>>> c.evaluate(4)
False

Previous topic

cf.set

Next topic

cf.wo

This Page