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

compute_jackson_cheby_coeff IndexError #39

Closed scottgigante closed 5 years ago

scottgigante commented 5 years ago

compute_jackson_cheby_coeff is indexing with a float. PR coming.

>>> import pygsp
>>> G = pygsp.graphs.Minnesota()
>>> G.estimate_lmax()
>>> pygsp.filters.compute_jackson_cheby_coeff([0, G.lmax/2], [0, G.lmax], 30)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/scottgigante/.local/lib/python3.7/site-packages/pygsp/filters/approximations.py", line 209, in compute_jackson_cheby_coeff
    (np.sin(i * np.arccos(filter_bounds[0])) - np.sin(i * np.arccos(filter_bounds[1])))
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
mdeff commented 5 years ago

Thanks!