yunruse / Noether

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

`repr()` is misbehaving #5

Closed yunruse closed 1 year ago

yunruse commented 1 year ago

I think I've leant on rich too much, because without it, the following is a bit borked:

>>> from noether import meter
>>> meter
Unit(value=1, stddev=None, dim=length  # length, length, distance, height, width, breadth, depth)
>>> conf.display_repr_code
False

This should only happen when display_repr_code is True. Additionally, the comment should not display when it is True!

This should be enforced by some unit testing, I think.

yunruse commented 1 year ago

repr(Dimension) and str(Dimension) seem swapped. repr should show alternate names and str not IMO

yunruse commented 1 year ago

Additionally,

yunruse commented 1 year ago

we should also expect no * in str():

>> str(K * m)
'1 K m'
yunruse commented 1 year ago

Fixed for v1.0.