epfl-lts2 / pygsp

Graph Signal Processing in Python
https://pygsp.rtfd.io
BSD 3-Clause "New" or "Revised" License
483 stars 93 forks source link

request to add networkx io in stable version #82

Closed Chen-Cai-OSU closed 4 years ago

Chen-Cai-OSU commented 4 years ago

Hello,

Thank you very much for the nice library! I was wondering would it be possible to add the networkx io related function (from_networkx/to_networkx) to the stable version of pygsp? Those seem to be quite important/natural functions but right now those can only be used in the development version.

I prefer the stable version because I am currently using a library built upon pygsp stable. If I switch to dev version, some functions of the library won't work.

StefanBloemheuvel commented 4 years ago

hi, I am also interested in this. Especially interested into exporting the result of a K-nn graph into a networkx graph.

nperraud commented 4 years ago

Hi @Chen-Cai-OSU and @StefanBloemheuvel Thanks for your interest. This will come, but I cannot not give you a deadline since our main contributor in charge of the versions is currently writing his PhD thesis and does not have a lot of time. For now, you can simply install the dev version. @StefanBloemheuvel Is the function you desire missing? Or simply not in the latest release?

StefanBloemheuvel commented 4 years ago

@nperraud Thank you for the fast reply, the function is indeed missing. I would like to transform the graphs.NNGraph output to networkX since I have to label the nodes. I have a sensor network including the coordinates of the sensors, so the most logical way was to create a NNgraph of the point cloud of x,y coordinates. Now I have to match the columns of my sensor data .csv file to the order of the nodes in the NNgraph, for which I think it would be most logical to export to networkX and label the nodes by hand. Or is there another way?

nperraud commented 4 years ago

I am not sure I understand what you want to do. But if you code a function to export a GSP graph to a networkX graph, we will be happily and thankfully waiting for your PR.

mdeff commented 4 years ago

We already have pygsp.graphs.Graph.to_networkx in master. These I/O functions will be in the next release. As @nperraud mentioned, use the dev version (pip install git+https://github.com/epfl-lts2/pygsp) in the meantime.

@Chen-Cai-OSU: the dev version (hence the next release) indeed contains breaking changes. The code you developed against the current stable version (v 0.5.1) must be updated if you want to update to the dev (master) or next stable version.