epfl-lts2 / pygsp

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

Can't run any examples #51

Closed dangpzanco closed 5 years ago

dangpzanco commented 5 years ago

Description

No example works.

Most of them have an error related to the number of arguments of the plot() function.

Versions

Windows-10-10.0.17763-SP0
Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
NumPy 1.16.3
SciPy 1.2.1
Matplotlib 3.0.3
pygsp 0.5.1

Code to Reproduce (and Results)

D:/Documents/GitHub/pygsp/examples> python eigenvalue_concentration.py
Traceback (most recent call last):
  File "eigenvalue_concentration.py", line 20, in <module>
    graph.plot(graph.U[:, 1], ax=ax[0])
TypeError: plot() takes 1 positional argument but 2 were given

D:/Documents/GitHub/pygsp/examples> python filtering.py
Traceback (most recent call last):
  File "filtering.py", line 28, in <module>
    g = pg.filters.Expwin(G, band_max=0.5)
  File "D:/Programs/Miniconda3/lib/site-packages/pygsp/filters/expwin.py", line 56, in __init__
    super(Expwin, self).__init__(G, g, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'band_max'

D:/Documents/GitHub/pygsp/examples> python fourier_basis.py
Traceback (most recent call last):
  File "fourier_basis.py", line 33, in <module>
    plot_eigenvectors(G, axes[0])
  File "fourier_basis.py", line 27, in plot_eigenvectors
    G.plot(G.U[:, i], limits=limits, colorbar=False, vertex_size=50, ax=ax)
TypeError: plot() takes 1 positional argument but 2 were given

D:/Documents/GitHub/pygsp/examples> python fourier_transform.py
Traceback (most recent call last):
  File "fourier_transform.py", line 32, in <module>
    G.plot(x, limits=[-limit, limit], ax=axes[0, i])
TypeError: plot() takes 1 positional argument but 2 were given

D:/Documents/GitHub/pygsp/examples> python heat_diffusion.py
Traceback (most recent call last):
  File "heat_diffusion.py", line 23, in <module>
    x = np.zeros(G.n_vertices)
AttributeError: 'Grid2d' object has no attribute 'n_vertices'

D:/Documents/GitHub/pygsp/examples> python kernel_localization.py
Traceback (most recent call last):
  File "kernel_localization.py", line 28, in <module>
    g.plot(ax=axs[0], title='heat kernel')
  File "D:/Programs/Miniconda3/lib/site-packages/pygsp/filters/filter.py", line 510, in plot
    plotting.plot_filter(self, **kwargs)
  File "D:/Programs/Miniconda3/lib/site-packages/pygsp/plotting.py", line 85, in inner
    plot(obj, *args, **kwargs)
TypeError: plot_filter() got an unexpected keyword argument 'title'

D:/Documents/GitHub/pygsp/examples> python random_walk.py
Traceback (most recent call last):
  File "random_walk.py", line 28, in <module>
    graph.plot(state, ax=ax, title=r'$/delta P^{}$'.format(step))
TypeError: plot() takes 1 positional argument but 2 were given

D:/Documents/GitHub/pygsp/examples> python wave_propagation.py
Traceback (most recent call last):
  File "wave_propagation.py", line 23, in <module>
    x = np.zeros(G.n_vertices)
AttributeError: 'Grid2d' object has no attribute 'n_vertices'
mdeff commented 5 years ago

Those examples are in the "latest" version of the documentation, hence target the master branch version of the PyGSP. Two options:

dangpzanco commented 5 years ago

Hmm, I think this happened because I installed the github master over the stable version. I just did a clean reinstall and it seems to work now, thanks!