def test_read_many_graph6(self): # Read many graphs into list data="""DF{\nD`{\nDqK\nD~{\n""" (fd,fname)=tempfile.mkstemp() fh=open(fname,'w') b=fh.write(data) fh.close() glist=nx.read_graph6_list(fname) assert_equal(len(glist),4) for G in glist: assert_equal(sorted(G.nodes()),[0, 1, 2, 3, 4]) os.close(fd) os.unlink(fname)
def load_all_graphs(fn): return nx.read_graph6_list(fn)