Value error while reading into csr graph
janvekarnaveed opened this issue · 4 comments
G = cg.read_edgelist("sample.edgelist", sep='\t')
this leads to the following error -
~/anaconda3/envs/python3/lib/python3.6/site-packages/csrgraph/graph.py in init(self, data, nodenames, copy, threads)
107 raise ValueError(f"""
108 Out of bounds node: {max_idx}, nnodes: {self.nnodes}
--> 109 """)
110 # Manage threading through Numba hack
111 if type(threads) is not int:
ValueError:
Out of bounds node: 170625, nnodes: 146040
I'll be available to fix it next week.
In the mean time, can you supply the sample edgelist so I can use it when reproducing the bug? Thanks
That'll be great if this issue can be fixed. sample_edgelist_0712.txt gives out of bounds error and largenumbererror.txt gives the following error -
ValueError Traceback (most recent call last)
in
1 import csrgraph as cg
2
----> 3 G = cg.read_edgelist("seller_edgelist_0712.edgelist", sep=',', header=None)
~/anaconda3/envs/python3/lib/python3.6/site-packages/csrgraph/graph.py in read_edgelist(f, sep, header, **readcsvkwargs)
457 SRC: {elist.src.max()}, {elist.src.min()}
458 DST: {elist.dst.max()}, {elist.dst.min()}
--> 459 """)
460 elist.src = elist.src.astype(np.uint32)
461 elist.dst = elist.dst.astype(np.uint32)
ValueError:
Invalid uint32 value in node IDs. Max/min :
SRC: 333333333, 11111111111
DST: 444444444, 2222222222
largenumbererror.txt
Hi,
I made some changes and fixed some bugs. The two error cases you provided should work and are in the unit tests now.
Please pull the current repo (not the pip version, which doesn't have the changes yet) to confirm it fixes the problem on your actual real world usecase.
Thanks!
I can confirm that changes made worked. I was able to read the edgelist in CSR graph object. Thank you so much!