fields.buffers.core.ArrayBuffer.convert_to_units#
- ArrayBuffer.convert_to_units(units: str | Unit, equivalence=None, **kwargs)[source]#
Convert this buffer’s data to the specified physical units (in-place).
This operation replaces the buffer’s internal data with a unit-converted equivalent. It modifies the object directly.
Not all buffer classes support in-place unit assignment. Subclasses that do not should override this method to raise an appropriate error.
- Parameters:
- Raises:
UnitConversionError – If the conversion is not dimensionally consistent.
NotImplementedError – If the subclass does not support in-place unit modification.
Notes
If the buffer’s units are None, this method assigns the new units directly without modifying data. Otherwise, it performs a physical conversion.