yunruse / Noether

Just another units package
MIT License
9 stars 0 forks source link

ComposedUnits have erroneous displays #43

Closed yunruse closed 1 year ago

yunruse commented 1 year ago

In-development bug.

Something is wrong with the display of units when a composed unit is used. For example, if we do display(length_unit), displaying a speed unit will get a little confused and change the display unit but not the display value.

Steps:

>>> knot
knot  # speed, 0.5144444444444445 m / s
>>> knot(1)
0.5144444444444445 m / s  # speed

>>> display(mile)

Observed results:

>>> knot
knot  # speed, 0.5144444444444445 mi / s
>>> knot(1)
0.5144444444444445 mi / s  # speed

See how mi is somehow taken, but not the inherent value modifier.

Expected results (obtained with @ mile/second):

>>> knot
0.0003196609577843174 mi / s  # speed

This could do with a unit test.

Obviously #1 needs fixing such that mile / hour is the canonical imperial display speed, but this numerical inaccuracy is a serious bug that must be fixed.

yunruse commented 1 year ago

Seems to be somehow fixed.