fog/test/clustering/utils.py

15 lines
483 B
Python
Raw Normal View History

2018-06-11 15:00:59 +00:00
# =============================================================================
# Fog Clustering Unit Tests Utilities
# =============================================================================
class Clusters(object):
def __init__(self, clusters):
self.groups = set(tuple(sorted(values)) for values in clusters)
def __eq__(self, other):
return self.groups == other.groups
2018-06-12 15:24:16 +00:00
def __repr__(self):
return 'Clusters(%s)' % self.groups.__repr__()