fields.mixins.components.FieldComponentCoreMixin.convert_to_units#
- FieldComponentCoreMixin.convert_to_units(units: str | Unit, equivalence: str | None = None, **kwargs)[source]#
Convert the component’s buffer to the specified units (in-place).
This operation modifies the underlying buffer directly and permanently converts all data to the given units. This is only valid if the buffer supports in-place unit reassignment or conversion.
- Parameters:
- Raises:
UnitConversionError – If the conversion is invalid or dimensionally inconsistent.
NotImplementedError – If the buffer does not support unit conversion.