Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_nx_input(self, mapper):
draw_matplotlib(km.to_networkx(mapper))
def test_convertions(self):
mapper = KeplerMapper(verbose=0)
data = np.random.rand(100, 2)
graph = mapper.map(data)
g = to_networkx(graph)
assert isinstance(g, nx.Graph)
def test_membership(self):
mapper = KeplerMapper(verbose=0)
data = np.random.rand(100, 2)
graph = mapper.map(data)
n, m = list(graph["nodes"].items())[0]
g = to_networkx(graph)
assert g.nodes[n]["membership"] == m