MDANSE icon indicating copy to clipboard operation
MDANSE copied to clipboard

[ENHANCEMENT] Migrate unit handling to `pint`

Open oerc0122 opened this issue 11 months ago • 0 comments

Is your feature request related to a problem? Please describe. Unit handling is currently handled by custom (somewhat restricted) unit lists.

By migrating to pint we would gain acces to a rich set of units with dimensionality checks and other benefits.

In the case of the json "registries", it would be possible to add an extended json parser to handle a units element in the dictionaries and return the appropriate Quantity objects.

Due to pint's issues with spectroscopic units (i.e. the conflict between nm / cm -1 and eV being fundamentally dimensionally different), we could use something similar (exactly) to Euphonic's spectroscopy unit registry (with appropriate acknowledgement).

Describe the solution you'd like pint as the main unit handler.

Describe alternatives you've considered N/A

Additional context c.f. #698

oerc0122 avatar Mar 25 '25 13:03 oerc0122