def diagram_filter(orig_sparse_diag, extension_chord, extended_sparse_diag): diag = Diagram(extended_sparse_diag) diag.compress() if (contains_one_move(diag) or contains_three_move(diag)): return False # Skip this diagram return True # Use this diagram
def test_compress(self): diag = Diagram([(2, 8), (4, 10), (6, 16), (12, 14)]) compressed_diag = Diagram([(1, 4), (2, 5), (3, 8), (6, 7)]) diag.compress() self.assertEqual(diag, compressed_diag)