LoadEdgeList / LoadEdgeListStr support for compressed files
Looking over the source code, it appears that LoadEdgeList() and LoadEdgeListStr() are supposed to support compressed files with filenames ending in .gz, .7z, .rar, .zip, .cab, .arj, .bzip2, and .bz2 by calling a system installation of 7zip. Here's the sequence of calls:
LoadEdgeList()
TSsParser::TSsParser()
TZipIn::New()
TZipIn::TZipIn()
FillBf()
I tested using LoadEdgeList() for loading gzipped text files (wiki-Vote.txt.gz) on Windows 10 and Ubuntu 18.04.
On Windows, adding the directory of 7-zip to the system-wide PATH variable allowed LoadEdgeList() to correctly read in the data.
>>> import snap
>>> snap.LoadEdgeList(snap.PNGraph, 'wiki-Vote.txt.gz', 0, 1)
<snap.PNGraph; proxy of <Swig Object of type 'PNGraph *' at 0x000002775C5601E0> >
However, on Ubuntu, despite having 7-zip installed at /usr/bin/7za (SNAP calls 7z.exe on Windows but 7za on other platforms), LoadEdgeList() fails, and I'm not sure why. (The error seems to be occurring here.)
>>> import snap
>>> snap.LoadEdgeList(snap.PNGraph, 'wiki-Vote.txt.gz', 0, 1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/bentyeh/miniconda3/envs/myenv/lib/python3.7/site-packages/snap.py", line 253436, in LoadEdgeList
if tspec == PNGraph : return LoadEdgeList_PNGraph(*args)
File "/home/bentyeh/miniconda3/envs/myenv/lib/python3.7/site-packages/snap.py", line 238872, in LoadEdgeList_PNGraph
return _snap.LoadEdgeList_PNGraph(*args)
RuntimeError: BytesRead != 0
Once this issue is resolved, I suggest updating the documentation for LoadEdgeList() and LoadEdgeListStr() to mention support for compressed files!