Commit b1ba2c0a authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Fix to skipUnchanged - np.all(a == b) might return true even if a and b have

different shapes
parent f4320ed1
......@@ -143,8 +143,13 @@ def skipUnchanged(func):
newIsArray = isinstance(value, np.ndarray)
isarray = oldIsArray or newIsArray
if isarray: nochange = np.all(oldVal == value)
else: nochange = oldVal == value
if isarray:
a = np.array(oldVal, copy=False)
b = np.array(value, copy=False)
nochange = (a.shape == b.shape) and np.allclose(a, b)
else:
nochange = oldVal == value
if nochange:
return False
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment