Registry / devops / ansys-units

ansys-units

JSON →
library0.12.0pypypi✓ verified 84d ago

A Pythonic interface for units, unit systems, and unit conversions within the Ansys ecosystem. Current version 0.12.0 supports Python 3.10-3.14. The library follows semantic versioning with regular releases.

pip install ansys-units
INSTALL
IMPORT
SIG · ANSYS-UNITS
A
ansys-units
devopspythonv0.12.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Quantity
from ansys.units import Quantity
from ansys.units.units import Quantity
Old submodule path deprecated; use top-level import.

Basic usage of Quantity for unit conversions and arithmetic.

from ansys.units import Quantity # Create a quantity with value and units q = Quantity(10.0, 'm') print(q) # 10.0 m # Convert to different units q_ft = q.to('ft') print(q_ft) # 32.8084 ft # Perform arithmetic q2 = Quantity(5.0, 's') print(q / q2) # 2.0 m/s # Check compatibility print(q.compatible('km')) # True print(q.compatible('kg')) # False
Debug
Known issues
gotchaQuantity multiplication/division may unexpectedly change units if not careful with order of operations.
fix
Use parentheses or explicit conversion with .to() before arithmetic.
affects: all
deprecatedImporting from ansys.units.units or ansys.units.quantity is deprecated. Use directly from ansys.units.
fix
Change import to 'from ansys.units import Quantity'.
affects: >=0.10
breakingIn version 0.11.0, the Quantity constructor changed to accept unit string as second positional argument (previously unit keyword).
fix
Use positional argument: Quantity(10.0, 'm') instead of Quantity(10.0, units='m').
affects: 0.11.0
Errors
Common errors & fixes
AttributeError: module 'ansys.units' has no attribute 'Quantity'
Installed version <0.10 where Quantity was in submodule.
fix
Upgrade to >=0.10 and use 'from ansys.units import Quantity'.
ValueError: Unknown unit: 'm/s'
Unit string may be case-sensitive or composite not recognized.
fix
Use 'm*s^-1' or 'meter/second' (check set_units).
Upgrade
Version history
0.12.0latest on PyPI · released May 27, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
ansys-units — pip install ansys-units · libregistry