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

from_networkx() and to_networkx() method are not working #103

Open skmda37 opened 2 years ago

skmda37 commented 2 years ago

The API example for the from_networkx() method is:

import networkx as nx
graph = nx.Graph()
graph.add_edge(1, 2, weight=0.2)
graph.add_edge(2, 3, weight=0.9)
graph.add_node(4, sig=3.1416)
graph.nodes()

graph = pygsp.graphs.Graph.from_networkx(graph)
graph.W.toarray()
graph.signals

I get the error AttributeError: type object 'Graph' has no attribute 'from_networkx' and have similar errors with the to_networkx() method and the LineGraph method.

My version of pygsp is 0.5.1 and for networkx 2.8.4 if that helps...

Thanks in advance!