mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-28 11:25:42 +08:00
pep8
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user