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

Heat filter not working #98

Closed jsnagai closed 3 years ago

jsnagai commented 3 years ago

Dear Developers,

First, thank you for developing the package that's a really nice work.

I was trying to run the Heat Diffusion example and I got this error

g = pg.filters.Heat(G,scale=[5, 10, 100]) g.append(lambda x, t=t, norm=norm: kernel(x, t) / norm) super(Heat, self).init(G, g, **kwargs)

TypeError: init() got an unexpected keyword argument 'scale'

My personal env is

Linux mint 19.3 pygsp in /usr/local/lib/python3.8/dist-packages (0.5.1) numpy in /usr/local/lib/python3.8/dist-packages (from pygsp) (1.19.4) scipy in /usr/local/lib/python3.8/dist-packages (from pygsp) (1.6.0)

bricaud commented 3 years ago

It is probably because the example works on the recent version on the master branch of the repository and the pip version is many commit away from it. Please try cloning the repository and use the master branch code. One day someone will make a new release...

mdeff commented 3 years ago

Thanks for the kind words @jsnagai! As @bricaud said, you're using the documentation and code of two different versions. You can either install the latest version from git with pip install --ignore-installed git+https://github.com/epfl-lts2/pygsp, or follow the stable documentation that corresponds to the version released on PyPI and conda.

jsnagai commented 3 years ago

Hi @mdeff and @bricaud, thank you for the quickly reply. I tried to install the package as you mentioned (using manual installation of master branch and using pip ) and it's still not working. Could it be that the problem is related to python version (I`m using 3.8 here).

mdeff commented 3 years ago

It shouldn't: we continuously test on python 3.6 to 3.9. Did you use the --ignore-installed option? Pip won't install the git version if the pypi version was already in your environment.

mdeff commented 3 years ago

On the pypi version, scale was called tau. So you might try to change that to make sure it's a version issue.

jsnagai commented 3 years ago

@mdeff I tried with old documentation code and it worked and I removed the previous instalations too. I`m just wondering why i cannot install the latest version.

mdeff commented 3 years ago

Ok good. I'm wondering too. What if you create a new environment and run pip install --ignore-installed git+https://github.com/epfl-lts2/pygsp?

jsnagai commented 3 years ago

Now it worked. Many thanks and have an awesome week

mdeff commented 3 years ago

Thanks. You too!