cfunits.Units.has_offset

Units.has_offset

True if the units contain an offset.

Note

Currently, reference time units are not considered as having an offset.

Note

If a multiplicative component of the units had an offset during instantiation, then the offset is ignored in the resulting Units object. See below for examples.

Examples

>>> Units('K').has_offset
False
>>> Units('K @ 0').has_offset
False
>>> Units('K @ 273.15').has_offset
True
>>> Units('degC').has_offset
True
>>> Units('degF').has_offset
True
>>> Units('Watt').has_offset
False
>>> Units('m2.kg.s-3').has_offset
False
>>> Units('km').has_offset
False
>>> Units('1000 m').has_offset
False
>>> Units('m2.kg.s-3 @ 3.14').has_offset
True
>>> Units('(K @ 273.15) m s-1').has_offset
False
>>> Units('degC m s-1').has_offset
False
>>> Units('degC m s-1') == Units('K m s-1')
True
>>> Units('days since 2000-01-01').has_offset
False