Tools for postprocessing

Tools are available for postprocessing the dataframes.

Constants and auxiliary functions

Scientific constants

Common scientific constants based on scipy.constants are provided for using across alchemlyb.

alchemlyb.postprocessors.units.kJ2kcal = 0.2390057361376673

conversion factor from kJ to kcal, based on scipy.constants.calorie

alchemlyb.postprocessors.units.R_kJmol = 0.008314462618

Gas constant \(R\) in kJ/(mol K), based on scipy.constants.R

Unit Conversion

For all of the input and output dataframes (such as u_nk, dHdl, Estimator.delta_f_, Estimator.d_delta_f_), the metadata is stored as pandas.DataFrame.attrs. The unit of the data could be converted to \(kT\), \(kJ/mol\) or \(kcal/mol\) via the to_kT(), to_kJmol(), to_kcalmol(). A dispatch table (get_unit_converter()) is also to provide the relevant converter.

>>> from alchemlyb.postprocessors.units import get_unit_converter
>>> get_unit_converter('kT')
<function to_kT>
>>> get_unit_converter('kJ/mol')
<function to_kJmol>
>>> get_unit_converter('kcal/mol')
<function to_kcalmol>

Unit Conversion Functions

units

Unit conversion and constants