agencyenterprise / neurotechdevkit

Neurotech Development Kit (NDK)
https://agencyenterprise.github.io/neurotechdevkit/
Apache License 2.0
117 stars 10 forks source link

Use `pint` to keep track of different units #133

Open charlesbmi opened 1 year ago

charlesbmi commented 1 year ago

Describe the new feature or enhancement

It would be helpful (especially for new contributers) to know exactly what units different variables use, and how to convert between the units. For example people seem to cite absorption in dB/cm or with MHz, etc.

Describe your proposed implementation

Use https://github.com/hgrecco/pint to annotate units. This would, e.g., replace utility functions like https://github.com/agencyenterprise/neurotechdevkit/blob/6e53d78a981885a06ca693bbcc1b4168367c267b/src/neurotechdevkit/results/_metrics.py#L292-L329 and https://github.com/agencyenterprise/neurotechdevkit/blob/6e53d78a981885a06ca693bbcc1b4168367c267b/src/neurotechdevkit/materials.py#L65-L76

Describe possible alternatives

https://github.com/python-quantities/python-quantities also looks like a suitable alternative. Seems slightly less active, with less frequent releases and fewer stars.