-
-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Description
Calculating the norm of a numpy array with uncertainties using numpy.linalg.norm throws an error which can be reproduced with the following MWE:
from uncertainties import unumpy
import numpy
a = unumpy.uarray([1, 1], [1, 1])
numpy.linalg.norm(unumpy.nominal_values(a)) # works fine
numpy.linalg.norm(a)
This throws the following exception:
AttributeError: 'AffineScalarFunc' object has no attribute 'sqrt'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<__array_function__ internals>", line 6, in norm
File "lib/python3.6/site-packages/numpy/linalg/linalg.py", line 2483, in norm
ret = sqrt(sqnorm)
TypeError: loop of ufunc does not support argument 0 of type AffineScalarFunc which has no callable sqrt method
This is with uncertainties version 3.1.2 and numpy version 1.17.4.
meliache
Metadata
Metadata
Assignees
Labels
No labels