diff --git a/HARK/core.py b/HARK/core.py index 119db0143..941ead370 100644 --- a/HARK/core.py +++ b/HARK/core.py @@ -62,7 +62,8 @@ def distanceMetric(thing_A, thing_B): if thing_A.shape == thing_B.shape: distance = np.max(abs(thing_A - thing_B)) else: - distance = np.max(abs(thing_A.shape - thing_B.shape)) + # Flatten arrays so there are in the same dimensions + distance = np.max(abs(thing_A.flatten().shape[0] - thing_B.flatten().shape[0])) # If none of the above cases, but the objects are of the same class, call # the distance method of one on the other elif thing_A.__class__.__name__ == thing_B.__class__.__name__: