is_unitless

mdcraft.algorithm.unit.is_unitless(value: Any) bool[source]

Determines whether a value is unitless.

Parameters:
valueAny

Value to check for unitlessness.

Returns:
is_unitlessbool

Whether the value is unitless.

Examples

>>> is_unitless(90.0)
True
>>> is_unitless("90 degrees")
False
>>> is_unitless(90.0 * ureg.degree)
False
>>> is_unitless(90.0 * unit.degree)
False
>>> is_unitless({"quantity": 90 * ureg.degree})
True