pyElli
pyElli copied to clipboard
Use pint for units
For easier unit conversion and loading we want to use pint. There are a few considerations
- As it integrates nicely with numpy arrays, we should make sure that it also works good with pandas and xarray (to support the further data representation path).
- It should be usable without overhead when default units are used, so maybe conversion can happen automatically for wavelengths in nm.
- It should make using data in other units as easy as possible (also conversion from wavenumber and energy), so it should be not more as using an
ureg("eV")to specifiy the unit of the data used.
I have two small things i have read, which i want to keep in mind:
- We have to expose the ureg from within pyelli.
- Pint should be avoided in performance critical calculations. but can be worked around and most of our calculations are done with scalars.
If we change our internal data structure to xarray it would be good to just add pint support via https://github.com/xarray-contrib/pint-xarray.