fields.buffers.base.BufferBase.convert_to_base#

BufferBase.convert_to_base(unit_system=None, equivalence=None, **kwargs)[source]#

Convert this buffer in-place to base units for the given unit system.

The base units are those defined by unyt for the specified unit system. This is equivalent to calling convert_to_units with .get_base_equivalent().

Parameters:
  • unit_system (str, optional) – Unit system to use for base units (e.g., “mks”, “cgs”). If not provided, defaults to MKS.

  • equivalence (str, optional) – Equivalence scheme to use during the conversion (if applicable).

  • **kwargs – Additional keyword arguments forwarded to the equivalence.

Raises:
  • UnitConversionError – If the conversion is not dimensionally valid.

  • NotImplementedError – If the buffer does not support unit conversion.