Beispiel #1
0
    def test_remove_duplicates_direct(self):
        nodes = defaultdict(list)
        nodes["cube1_cluster0"] = [0]
        nodes["cube1_cluster1"] = [1, 2]
        nodes["cube1_cluster2"] = [1, 2, 3]
        nodes["cube2_cluster0"] = [1, 2]
        nodes["cube2_cluster1"] = [2, 3, 4]

        mapper = KeplerMapper()
        deduped_nodes = mapper._remove_duplicate_nodes(nodes)

        assert len(deduped_nodes) < len(nodes)
        assert len(deduped_nodes) == 4
        assert ("cube1_cluster1|cube2_cluster0" in deduped_nodes
                or "cube2_cluster0|cube1_cluster1" in deduped_nodes)