You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>> q.Quantity(1, "km")
array(1) * km
>>> a=q.Quantity(1, "N")
>>> a
array(1) * N
>>> a=q.Quantity(1, "kN")
Traceback (most recent call last):
File "/home/andrea_palazzi/funimatic-venv/lib/python3.13/site-packages/quantities/registry.py", line 33, in __getitem__
return eval(string, self.__context)
File "<string>", line 1, in <module>
NameError: name 'kN' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<python-input-10>", line 1, in <module>
a=q.Quantity(1, "kN")
File "/home/andrea_palazzi/funimatic-venv/lib/python3.13/site-packages/quantities/quantity.py", line 131, in __new__
ret._dimensionality.update(validate_dimensionality(units))
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
File "/home/andrea_palazzi/funimatic-venv/lib/python3.13/site-packages/quantities/quantity.py", line 34, in validate_dimensionality
return unit_registry[value].dimensionality
~~~~~~~~~~~~~^^^^^^^
File "/home/andrea_palazzi/funimatic-venv/lib/python3.13/site-packages/quantities/registry.py", line 73, in __getitem__
return self.__registry[label]
~~~~~~~~~~~~~~~^^^^^^^
File "/home/andrea_palazzi/funimatic-venv/lib/python3.13/site-packages/quantities/registry.py", line 36, in __getitem__
raise LookupError(
'Unable to parse units: "%s"'%string
)
LookupError: Unable to parse units: "kN"
The text was updated successfully, but these errors were encountered:
apdavison
added a commit
to apdavison/python-quantities
that referenced
this issue
Feb 5, 2025
As per title, current quantities cannot parse kN:
The text was updated successfully, but these errors were encountered: