Use a.item() instead of deprecated np.asscalar(a)

np.asscalar() has been deprecated in numpy 1.16:

https://github.com/numpy/numpy/blob/master/doc/release/1.16.0-notes.rst#new-deprecations
This commit is contained in:
Bruno Oliveira 2019-01-14 08:59:09 -02:00
parent 1bb463a980
commit 42bb0b3904
1 changed files with 2 additions and 2 deletions

View File

@ -150,10 +150,10 @@ class ApproxNumpy(ApproxBase):
if np.isscalar(actual):
for i in np.ndindex(self.expected.shape):
yield actual, np.asscalar(self.expected[i])
yield actual, self.expected[i].item()
else:
for i in np.ndindex(self.expected.shape):
yield np.asscalar(actual[i]), np.asscalar(self.expected[i])
yield actual[i].item(), self.expected[i].item()
class ApproxMapping(ApproxBase):