Units Utility
Unit metadata utilities for ReaxKit quantities.
This module provides access to display units associated with canonical quantity keys used across ReaxFF files and ReaxKit analyses.
Unit definitions are stored in the packaged file
reaxkit/data/units.yaml and loaded on demand.
unit_for(key, default=None)
Retrieve the display unit for a canonical quantity key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Canonical quantity key (e.g., |
required |
default
|
str
|
Unit string to return if the key is not defined. |
None
|
Returns:
| Type | Description |
|---|---|
str or None
|
Unit string if found; otherwise |
Examples:
>>> unit_for("energy")
>>> unit_for("pressure", default="MPa")