ansys / pyansys-units

Pythonic interface for units, unit systems, and unit conversions.
http://units.docs.pyansys.com/
MIT License
6 stars 2 forks source link

feat: Register unit #282

Open hpohekar opened 3 months ago

hpohekar commented 3 months ago

Register unit without updating yaml file.

    >>> from ansys.units import register_unit
    >>> register_unit(unit="Q", composition="N m", factor=1)
    >>> ureg = UnitRegistry()
    >>> ureg.Q
    _name: Q
    _dimensions: {'MASS': 1.0, 'LENGTH': 2.0, 'TIME': -2.0}
    _composition: N m
    _factor: 1
    _si_units: kg m^2 s^-2
    _si_scaling_factor: 1.0
    _si_offset: 0.0