pulsesuite.libpulsesuite.units¶
Author: Rahul R. Sah
Classes¶
Scientific units and prefix handling for high-performance computing. |
Module Contents¶
- class pulsesuite.libpulsesuite.units.Units¶
Scientific units and prefix handling for high-performance computing.
Provides prefix scaling, unit parsing, and formatting for SI and binary units. All methods use camelCase. Thread-safe and context-enabled.
Examples
>>> Units.prefixVal('k') 1000.0 >>> Units.splitUnit('km') ('k', 'm') >>> Units.unitVal('1.5 km', 'm') 1500.0
- classmethod unitForVal(base: str, val: float, binary: bool = False) Tuple[float, str]¶
Returns the closest prefix for a value and scales the value.
- classmethod unitVal(n: str, unit: str | None = None) float¶
Attempts to cast a value and unit to a base.