Currently, if a user tries to perform unit conversion on a Value object and does not have pint installed, it raises an error:
from orsopy.fileio.model_language import Value
val = Value(5.0, 'nm')
val.as_unit("angstrom")
produces an import error for pint. This is a problem because pint is not an installation requirement for orsopy, but it seems orsopy depends on it. I think that either:
pint needs to be added to the requirements (and then the pint types can be used instead of the orsopy Value classes!)
- or
- a more descriptive error telling the user that they can only do unit conversions if they install
pint should be added (and maybe popular unit conversions like nm <-> angstrom can be provided by orsopy itself)