chemparseplot.units#

Unit registry and quantity helpers via pint.

Added in version 0.0.2.

Pint is imported on first access so a bare package import stays light. Energy presentation units (eV, kcal/mol, kJ/mol) are defined on a small chemical-energy dimension so conversions used by plot/parse helpers go through Quantity.to instead of ad-hoc floats.

Module Contents#

Functions#

normalize_energy_unit

Map aliases to a canonical energy presentation unit name.

_ensure_registry

__getattr__

as_energy_quantity

Wrap values as a pint Quantity in a chemical-energy presentation unit.

energy_quantity

Alias of :func:as_energy_quantity.

convert_energy_magnitude

Convert energy magnitudes between presentation units via pint.

Data#

API#

chemparseplot.units.__all__#

[‘ENERGY_UNITS’, ‘Q_’, ‘as_energy_quantity’, ‘convert_energy_magnitude’, ‘energy_quantity’, ‘normali…

chemparseplot.units.ENERGY_UNITS#

(‘eV’, ‘kcal/mol’, ‘kJ/mol’)

chemparseplot.units._ENERGY_PINT_NAME#

None

chemparseplot.units._ENERGY_TO_EV#

None

chemparseplot.units._ureg#

None

chemparseplot.units._Q#

None

chemparseplot.units.normalize_energy_unit(unit: str) str[source]#

Map aliases to a canonical energy presentation unit name.

chemparseplot.units._ensure_registry()[source]#
chemparseplot.units.__getattr__(name: str) Any[source]#
chemparseplot.units.as_energy_quantity(values: Any, unit: str = 'eV')[source]#

Wrap values as a pint Quantity in a chemical-energy presentation unit.

chemparseplot.units.energy_quantity(values: Any, unit: str = 'eV')[source]#

Alias of :func:as_energy_quantity.

chemparseplot.units.convert_energy_magnitude(values: Any, unit: str, *, source_unit: str = 'eV') numpy.ndarray[source]#

Convert energy magnitudes between presentation units via pint.