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
I did not find any information on parsing strings in order to initiate a Measurement object in the pint documentation. The method described for the Quantity object shows an unwanted behaviour and creates a product if ± is used as separator between nominal value and uncertainty. In the case of +/-, a DefinitionSyntaxError is raised.
Example:
import pint
ureg = pint.UnitRegistry()
for item in ['123 g','123 ± 3 g', '123 +/- 3 g']:
print(ureg(item))
I did not find any information on parsing strings in order to initiate a Measurement object in the pint documentation. The method described for the Quantity object shows an unwanted behaviour and creates a product if
±
is used as separator between nominal value and uncertainty. In the case of+/-
, aDefinitionSyntaxError
is raised.Example:
Output:
I used version 0.20.1 of pint in the example.
The text was updated successfully, but these errors were encountered: