ansys / pyansys-units

Pythonic interface for units, unit systems, and unit conversions.
http://units.docs.pyansys.com/
MIT License
6 stars 2 forks source link

Unappended multipliers are allowed #256

Closed seanpearsonuk closed 7 months ago

seanpearsonuk commented 7 months ago
>>> t = Q_(1, "h")
>>> t.to("k")
Quantity (1.0, "")

We need to raise an exception.

Also, h is not supported for hour.

hpohekar commented 7 months ago

@seanpearsonuk "h" and "k" are undefined units.

We should not allow construction of undefined units ("h") or unit terms ("h^2 k^-1")

We should raise an exception while constructing these quantities.

We were raising "Not implemented" exception in previous version of quantity. No idea why we have removed this check from Dimension class.

image

----------------------------------------------

image