Implement change suggested by @kalekundert in PR
This commit is contained in:
parent
2eb9301ad5
commit
d0ba242c46
|
@ -211,9 +211,7 @@ class ApproxScalar(ApproxBase):
|
||||||
the pre-specified tolerance.
|
the pre-specified tolerance.
|
||||||
"""
|
"""
|
||||||
if _is_numpy_array(actual):
|
if _is_numpy_array(actual):
|
||||||
import numpy as np
|
return all(a == self for a in actual)
|
||||||
|
|
||||||
return np.all(abs(self.expected - actual) <= self.tolerance)
|
|
||||||
|
|
||||||
# Short-circuit exact equality.
|
# Short-circuit exact equality.
|
||||||
if actual == self.expected:
|
if actual == self.expected:
|
||||||
|
|
Loading…
Reference in New Issue