Skip to content

Commit

Permalink
Make uncertainties compatible with numpy 2.0 (#245)
Browse files Browse the repository at this point in the history
use `dot` and `isscalar` from `numpy` instead of older `numeric` in `unumpy.core` to work with Numpy 2.0
  • Loading branch information
eendebakpt authored Jul 4, 2024
1 parent 35ab5e8 commit 4b309a6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions uncertainties/unumpy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

# 3rd-party modules:
import numpy
from numpy.core import numeric

# Local modules:
import uncertainties.umath_core as umath_core
Expand Down Expand Up @@ -585,10 +584,10 @@ def __rmul__(self, other):
# scalar and of a matrix containing objects (when the
# arguments are given in this order). We go around this
# limitation:
if numeric.isscalar(other):
return numeric.dot(self, other)
if numpy.isscalar(other):
return numpy.dot(self, other)
else:
return numeric.dot(other, self) # The order is important
return numpy.dot(other, self) # The order is important

def getI(self):
"""Matrix inverse or pseudo-inverse."""
Expand Down

0 comments on commit 4b309a6

Please sign in to comment.