woo._units

Woo is internally unit-agnostic (using SI units is highly recommended). This module defines conversion multipliers for various units; values of multipliers are taken from c++ sources.

The unit map is exposed as woo.unit, so that expressions like 16*woo.unit['deg'] can be used in python.

woo._units.baseUnit = {'%': '-', '-': '-', 'GPa': 'Pa', 'J/m²': 'J/m²', 'MN': 'N', 'MN·m': 'N·m', 'MPa': 'Pa', 'Mt/y': 'kg/s', 'N': 'N', 'N·m': 'N·m', 'N·m·s': 'N·m·s', 'Pa': 'Pa', 'cm': 'm', 'day': 's', 'deg': 'rad', 'g': 'kg', 'g/cm³': 'kg/m³', 'in': 'm', 'kN': 'N', 'kN·m': 'N·m', 'kPa': 'Pa', 'kg': 'kg', 'kg/m³': 'kg/m³', 'kg/s': 'kg/s', 'kg·m²': 'kg·m²', 'km/h': 'm/s', 'm': 'm', 'm/min': 'm/s', 'm/s': 'm/s', 'm/s²': 'm/s²', 'mm': 'm', 'mm²': 'm²', 'mm³': 'm³', 'ms': 's', 'm²': 'm²', 'm³': 'm³', 'ppm': '-', 'rad': 'rad', 'rad/s': 'rad/s', 'rot/min': 'rad/s', 'rot/s': 'rad/s', 'rph': 'rad/s', 'rpm': 'rad/s', 's': 's', 't': 'kg', 't/h': 'kg/s', 't/m³': 'kg/m³', 't/y': 'kg/s', 'year': 's', 'μs': 's', '‰': '-'}

Map units to their base units (with unit multiplier)

woo._units.unit = {'%': 0.01, '-': 1.0, 'GPa': 999999999.9999999, 'J/m²': 1.0, 'MN': 1000000.0, 'MN·m': 1000000.0, 'MPa': 1000000.0, 'Mt/y': 31.709791983764585, 'N': 1.0, 'N·m': 1.0, 'N·m·s': 1.0, 'Pa': 1.0, 'cm': 0.01, 'day': 86400.0, 'deg': 0.017453292519943295, 'g': 0.001, 'g/cm³': 1000.0, 'in': 0.0254, 'kN': 1000.0, 'kN·m': 1000.0, 'kPa': 1000.0, 'kg': 1.0, 'kg/m³': 1.0, 'kg/s': 1.0, 'kg·m²': 1.0, 'km/h': 0.2777777777777778, 'm': 1.0, 'm/min': 0.016666666666666666, 'm/s': 1.0, 'm/s²': 1.0, 'mm': 0.001, 'mm²': 1e-06, 'mm³': 1e-09, 'ms': 0.001, 'm²': 1.0, 'm³': 1.0, 'ppm': 1e-06, 'rad': 1.0, 'rad/s': 1.0, 'rot/min': 0.10471975511965977, 'rot/s': 6.283185307179586, 'rph': 0.0017453292519943296, 'rpm': 0.10471975511965977, 's': 1.0, 't': 1000.0, 't/h': 0.2777777777777778, 't/m³': 1000.0, 't/y': 3.1709791983764585e-05, 'year': 31536000.0, 'μs': 1e-06, '‰': 0.001}

Map units to their respective multipliers

Tip

Report issues or inclarities to github.