Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value error while reading into csr graph #3

Closed
janvekarnaveed opened this issue Jul 15, 2020 · 4 comments
Closed

Value error while reading into csr graph #3

janvekarnaveed opened this issue Jul 15, 2020 · 4 comments

Comments

@janvekarnaveed
Copy link

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

@VHRanger
Copy link
Owner

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

@janvekarnaveed
Copy link
Author

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

sample_edgelist_0712.txt

@VHRanger
Copy link
Owner

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!

@janvekarnaveed
Copy link
Author

I can confirm that changes made worked. I was able to read the edgelist in CSR graph object. Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants