This is not exactly an issue of pint but maybe you can help me. I am using both pint and uncertainties to avoid tedious calculations. When operations consist only in +,-,* and / everything works perfectly. The problem arises when I try to use other functions of the uncertainties package such as cosine(), sqrt(), etc. A MWE of what I am trying to do is as follows
import uncertainties as un
from uncertainties.umath import *
import pint
ureg = pint.UnitRegistry()
a = un.ufloat(10,1)*ureg.meter
b = un.ufloat(2,0.1)*ureg.meter
print(a/b) # This works nice
print(sqrt(un.ufloat(3,1))) # This works nice
print(sqrt(a/b)) # This fails
As far as I know the problem is that sqrt() is waiting for a ufloat object. Is there any way to implement this?
This is not exactly an issue of pint but maybe you can help me. I am using both pint and uncertainties to avoid tedious calculations. When operations consist only in +,-,* and / everything works perfectly. The problem arises when I try to use other functions of the uncertainties package such as cosine(), sqrt(), etc. A MWE of what I am trying to do is as follows
As far as I know the problem is that sqrt() is waiting for a ufloat object. Is there any way to implement this?