vrtulka23/scinumtools

Reduction of base units

vrtulka23 opened this issue · 1 comments

Add automatic and/or triggered reduction of complicated base units.

>>> import scinumtools as snt
>>> q = snt.quant(23, 'km/s')
>>> q *= snt.quant(2, 'h')
>>> q
Quantity(4.600e+01 km*s-1*h)
>>> q.to('km')
Quantity(1.656e+05 km)

In this case, it would be nice if resulting quantity would be already given in "km" instead of "kms-1h"

Implemented in the quantity class as method rebase().