This commit is contained in:
Vighnesh Birodkar
2014-03-26 03:51:59 +05:30
parent ace11b852e
commit ab06d0177b
+4 -4
View File
@@ -329,17 +329,17 @@ class _RegionProperties(MutableMapping):
return getattr(self, PROPS[key])
def __eq__(self, other):
if not isinstance(other,_RegionProperties):
if not isinstance(other, _RegionProperties):
return False
attr1 = np.array([getattr(self, k, None)for k in PROP_VALS])
attr2 = np.array([getattr(other, k, None)for k in PROP_VALS])
for x,y in zip(attr1, attr2):
for x, y in zip(attr1, attr2):
try:
#so that NaNs are equal
np.testing.assert_equal(x,y)
except AssertionError :
np.testing.assert_equal(x, y)
except AssertionError:
return False
return True