Skip to content

Commit ca0cd19

Browse files
authored
Merge branch 'master' into nn_refactor
2 parents 62fc0ce + 361f025 commit ca0cd19

18 files changed

+93
-41
lines changed

.zenodo.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"title": "PyGSP: Graph Signal Processing in Python",
3+
"description": "The PyGSP facilitates a wide variety of operations on graphs, like computing their Fourier basis, filtering or interpolating signals, plotting graphs, signals, and filters.",
4+
"upload_type": "software",
5+
"license": "BSD-3-Clause",
6+
"access_right": "open",
7+
"creators": [
8+
{
9+
"name": "Micha\u00ebl Defferrard",
10+
"affiliation": "EPFL",
11+
"orcid": "0000-0002-6028-9024"
12+
},
13+
{
14+
"name": "Lionel Martin",
15+
"affiliation": "EPFL"
16+
},
17+
{
18+
"name": "Rodrigo Pena",
19+
"affiliation": "EPFL"
20+
},
21+
{
22+
"name": "Nathana\u00ebl Perraudin",
23+
"affiliation": "EPFL",
24+
"orcid": "0000-0001-8285-1308"
25+
}
26+
],
27+
"related_identifiers": [
28+
{
29+
"scheme": "url",
30+
"identifier": "https://github.com/epfl-lts2/pygsp",
31+
"relation": "isSupplementTo"
32+
},
33+
{
34+
"scheme": "doi",
35+
"identifier": "10.5281/zenodo.1003157",
36+
"relation": "isPartOf"
37+
}
38+
]
39+
}

CONTRIBUTING.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ Making a release
5757

5858
Log in as the LTS2 user.
5959
#. Build and upload the distribution to the real PyPI with ``make release``.
60+
#. Update the conda feedstock (at least the version number and sha256 in
61+
``recipe/meta.yaml``) by sending a PR to
62+
`conda-forge <https://github.com/conda-forge/pygsp-feedstock>`_.
6063

6164
Repository organization
6265
-----------------------

README.rst

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ PyGSP: Graph Signal Processing in Python
1414
:target: https://pygsp.readthedocs.io
1515
.. |pypi| image:: https://img.shields.io/pypi/v/pygsp.svg
1616
:target: https://pypi.python.org/pypi/PyGSP
17-
.. |zenodo| image:: https://zenodo.org/badge/16276560.svg
17+
.. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1003157.svg
1818
:target: https://doi.org/10.5281/zenodo.1003157
1919
.. |license| image:: https://img.shields.io/pypi/l/pygsp.svg
2020
:target: https://github.com/epfl-lts2/pygsp/blob/master/LICENSE.txt
@@ -33,13 +33,11 @@ PyGSP: Graph Signal Processing in Python
3333

3434
The PyGSP is a Python package to ease
3535
`Signal Processing on Graphs <https://arxiv.org/abs/1211.0053>`_.
36-
It is a free software, distributed under the BSD license, and
37-
available on `PyPI <https://pypi.python.org/pypi/PyGSP>`_.
3836
The documentation is available on
3937
`Read the Docs <https://pygsp.readthedocs.io>`_
4038
and development takes place on
4139
`GitHub <https://github.com/epfl-lts2/pygsp>`_.
42-
(A `Matlab counterpart <https://epfl-lts2.github.io/gspbox-html>`_ exists.)
40+
(A (mostly unmaintained) `Matlab counterpart <https://epfl-lts2.github.io/gspbox-html>`_ exists.)
4341

4442
The PyGSP facilitates a wide variety of operations on graphs, like computing
4543
their Fourier basis, filtering or interpolating signals, plotting graphs,
@@ -60,8 +58,15 @@ main objects of the package.
6058

6159
>>> from pygsp import graphs, filters
6260
>>> G = graphs.Logo()
63-
>>> G.estimate_lmax()
64-
>>> g = filters.Heat(G, tau=100)
61+
>>> G.compute_fourier_basis() # Fourier to plot the eigenvalues.
62+
>>> # G.estimate_lmax() is otherwise sufficient.
63+
>>> g = filters.Heat(G, tau=50)
64+
>>> g.plot()
65+
66+
.. image:: ../pygsp/data/readme_example_filter.png
67+
:alt:
68+
.. image:: pygsp/data/readme_example_filter.png
69+
:alt:
6570

6671
Let's now create a graph signal: a set of three Kronecker deltas for that
6772
example. We can now look at one step of heat diffusion by filtering the deltas
@@ -73,11 +78,11 @@ structure!
7378
>>> s = np.zeros(G.N)
7479
>>> s[DELTAS] = 1
7580
>>> s = g.filter(s)
76-
>>> G.plot_signal(s, highlight=DELTAS, backend='matplotlib')
81+
>>> G.plot_signal(s, highlight=DELTAS)
7782

78-
.. image:: ../pygsp/data/readme_example.png
83+
.. image:: ../pygsp/data/readme_example_graph.png
7984
:alt:
80-
.. image:: pygsp/data/readme_example.png
85+
.. image:: pygsp/data/readme_example_graph.png
8186
:alt:
8287

8388
You can
@@ -86,7 +91,7 @@ look at the
8691
`tutorials <https://pygsp.readthedocs.io/en/stable/tutorials/index.html>`_
8792
to learn how to use it, or look at the
8893
`reference guide <https://pygsp.readthedocs.io/en/stable/reference/index.html>`_
89-
for an exhaustive documentation of the API. Enjoy the package!
94+
for an exhaustive documentation of the API. Enjoy!
9095

9196
Installation
9297
------------
@@ -115,6 +120,16 @@ research purpose at the `EPFL LTS2 laboratory <https://lts2.epfl.ch>`_.
115120
This project has been partly funded by the Swiss National Science Foundation
116121
under grant 200021_154350 "Towards Signal Processing on Graphs".
117122

123+
The code in this repository is released under the terms of the `BSD 3-Clause license <LICENSE.txt>`_.
124+
118125
If you are using the library for your research, for the sake of
119126
reproducibility, please cite the version you used as indexed by
120127
`Zenodo <https://doi.org/10.5281/zenodo.1003157>`_.
128+
Or cite the generic concept as::
129+
130+
@misc{pygsp,
131+
title = {PyGSP: Graph Signal Processing in Python},
132+
author = {Defferrard, Micha\"el and Martin, Lionel and Pena, Rodrigo and Perraudin, Nathana\"el},
133+
doi = {10.5281/zenodo.1003157},
134+
url = {https://github.com/epfl-lts2/pygsp/},
135+
}

pygsp/data/readme_example_filter.png

20.4 KB
Loading
File renamed without changes.

pygsp/filters/abspline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Abspline(Filter):
4040
4141
"""
4242

43-
def __init__(self, G, Nf=6, lpfactor=20, scales=None, **kwargs):
43+
def __init__(self, G, Nf=6, lpfactor=20, scales=None):
4444

4545
def kernel_abspline3(x, alpha, beta, t1, t2):
4646
M = np.array([[1, t1, t1**2, t1**3],
@@ -98,4 +98,4 @@ def kernel_abspline3(x, alpha, beta, t1, t2):
9898
lminfac = .6 * G.lmin
9999
g[0] = lambda x: gamma_l * gl(x / lminfac)
100100

101-
super(Abspline, self).__init__(G, g, **kwargs)
101+
super(Abspline, self).__init__(G, g)

pygsp/filters/expwin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Expwin(Filter):
3333
3434
"""
3535

36-
def __init__(self, G, bmax=0.2, a=1., **kwargs):
36+
def __init__(self, G, bmax=0.2, a=1.):
3737

3838
def fx(x, a):
3939
y = np.exp(-float(a)/x)
@@ -53,4 +53,4 @@ def ffin(x, a):
5353

5454
g = [lambda x: ffin(np.float64(x)/bmax/G.lmax, a)]
5555

56-
super(Expwin, self).__init__(G, g, **kwargs)
56+
super(Expwin, self).__init__(G, g)

pygsp/filters/filter.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ class Filter(object):
3131
G : Graph
3232
The graph to which the filter bank was tailored. It is a reference to
3333
the graph passed when instantiating the class.
34-
kernels : function or list of functions
35-
A (list of) function defining the filter bank. One function per filter.
36-
Either passed by the user when instantiating the base class, either
37-
constructed by the derived classes.
3834
Nf : int
3935
Number of filters in the filter bank.
4036
@@ -93,8 +89,8 @@ def evaluate(self, x):
9389
"""
9490
# Avoid to copy data as with np.array([g(x) for g in self._kernels]).
9591
y = np.empty((self.Nf, len(x)))
96-
for i, g in enumerate(self._kernels):
97-
y[i] = g(x)
92+
for i, kernel in enumerate(self._kernels):
93+
y[i] = kernel(x)
9894
return y
9995

10096
def filter(self, s, method='chebyshev', order=30):

pygsp/filters/halfcosine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class HalfCosine(Filter):
3131
3232
"""
3333

34-
def __init__(self, G, Nf=6, **kwargs):
34+
def __init__(self, G, Nf=6):
3535

3636
if Nf <= 2:
3737
raise ValueError('The number of filters must be higher than 2.')
@@ -45,4 +45,4 @@ def __init__(self, G, Nf=6, **kwargs):
4545
for i in range(Nf):
4646
g.append(lambda x, ind=i: main_window(x - dila_fact/3. * (ind - 2)))
4747

48-
super(HalfCosine, self).__init__(G, g, **kwargs)
48+
super(HalfCosine, self).__init__(G, g)

pygsp/filters/heat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class Heat(Filter):
6161
6262
"""
6363

64-
def __init__(self, G, tau=10, normalize=False, **kwargs):
64+
def __init__(self, G, tau=10, normalize=False):
6565

6666
try:
6767
iter(tau)
@@ -76,4 +76,4 @@ def kernel(x, t):
7676
norm = np.linalg.norm(kernel(G.e, t)) if normalize else 1
7777
g.append(lambda x, t=t, norm=norm: kernel(x, t) / norm)
7878

79-
super(Heat, self).__init__(G, g, **kwargs)
79+
super(Heat, self).__init__(G, g)

pygsp/filters/held.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Held(Filter):
4545
4646
"""
4747

48-
def __init__(self, G, a=2./3, **kwargs):
48+
def __init__(self, G, a=2./3):
4949

5050
g = [lambda x: held(x * (2./G.lmax), a)]
5151
g.append(lambda x: np.real(np.sqrt(1 - (held(x * (2./G.lmax), a))
@@ -67,4 +67,4 @@ def held(val, a):
6767

6868
return y
6969

70-
super(Held, self).__init__(G, g, **kwargs)
70+
super(Held, self).__init__(G, g)

pygsp/filters/itersine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Itersine(Filter):
3535
>>> G.plot_signal(s, ax=axes[1])
3636
3737
"""
38-
def __init__(self, G, Nf=6, overlap=2., **kwargs):
38+
def __init__(self, G, Nf=6, overlap=2.):
3939

4040
def k(x):
4141
return np.sin(0.5*np.pi*np.power(np.cos(x*np.pi), 2)) * ((x >= -0.5)*(x <= 0.5))
@@ -46,4 +46,4 @@ def k(x):
4646
for i in range(1, Nf + 1):
4747
g.append(lambda x, ind=i: k(x/scale - (ind - overlap/2.)/overlap) / np.sqrt(overlap)*np.sqrt(2))
4848

49-
super(Itersine, self).__init__(G, g, **kwargs)
49+
super(Itersine, self).__init__(G, g)

pygsp/filters/mexicanhat.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ class MexicanHat(Filter):
5555
5656
"""
5757

58-
def __init__(self, G, Nf=6, lpfactor=20, scales=None, normalize=False,
59-
**kwargs):
58+
def __init__(self, G, Nf=6, lpfactor=20, scales=None, normalize=False):
6059

6160
lmin = G.lmax / lpfactor
6261

@@ -82,4 +81,4 @@ def kernel(x, i=i):
8281

8382
kernels.append(kernel)
8483

85-
super(MexicanHat, self).__init__(G, kernels, **kwargs)
84+
super(MexicanHat, self).__init__(G, kernels)

pygsp/filters/meyer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Meyer(Filter):
4242
4343
"""
4444

45-
def __init__(self, G, Nf=6, scales=None, **kwargs):
45+
def __init__(self, G, Nf=6, scales=None):
4646

4747
if scales is None:
4848
scales = (4./(3 * G.lmax)) * np.power(2., np.arange(Nf-2, -1, -1))
@@ -90,4 +90,4 @@ def v(x):
9090

9191
return r
9292

93-
super(Meyer, self).__init__(G, g, **kwargs)
93+
super(Meyer, self).__init__(G, g)

pygsp/filters/papadakis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Papadakis(Filter):
4040
>>> G.plot_signal(s, ax=axes[1])
4141
4242
"""
43-
def __init__(self, G, a=0.75, **kwargs):
43+
def __init__(self, G, a=0.75):
4444

4545
g = [lambda x: papadakis(x * (2./G.lmax), a)]
4646
g.append(lambda x: np.real(np.sqrt(1 - (papadakis(x*(2./G.lmax), a)) **
@@ -61,4 +61,4 @@ def papadakis(val, a):
6161

6262
return y
6363

64-
super(Papadakis, self).__init__(G, g, **kwargs)
64+
super(Papadakis, self).__init__(G, g)

pygsp/filters/regular.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Regular(Filter):
4848
>>> G.plot_signal(s, ax=axes[1])
4949
5050
"""
51-
def __init__(self, G, d=3, **kwargs):
51+
def __init__(self, G, d=3):
5252

5353
g = [lambda x: regular(x * (2./G.lmax), d)]
5454
g.append(lambda x: np.real(np.sqrt(1 - (regular(x * (2./G.lmax), d))
@@ -65,4 +65,4 @@ def regular(val, d):
6565

6666
return np.sin(np.pi / 4.*(1 + output))
6767

68-
super(Regular, self).__init__(G, g, **kwargs)
68+
super(Regular, self).__init__(G, g)

pygsp/filters/simoncelli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Simoncelli(Filter):
4141
4242
"""
4343

44-
def __init__(self, G, a=2./3, **kwargs):
44+
def __init__(self, G, a=2./3):
4545

4646
g = [lambda x: simoncelli(x * (2./G.lmax), a)]
4747
g.append(lambda x: np.real(np.sqrt(1 -
@@ -63,4 +63,4 @@ def simoncelli(val, a):
6363

6464
return y
6565

66-
super(Simoncelli, self).__init__(G, g, **kwargs)
66+
super(Simoncelli, self).__init__(G, g)

pygsp/filters/simpletight.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class SimpleTight(Filter):
4242
4343
"""
4444

45-
def __init__(self, G, Nf=6, scales=None, **kwargs):
45+
def __init__(self, G, Nf=6, scales=None):
4646

4747
def kernel(x, kerneltype):
4848
r"""
@@ -98,4 +98,4 @@ def h(x):
9898
for i in range(Nf - 1):
9999
g.append(lambda x, i=i: kernel(scales[i] * x, 'wavelet'))
100100

101-
super(SimpleTight, self).__init__(G, g, **kwargs)
101+
super(SimpleTight, self).__init__(G, g)

0 commit comments

Comments
 (0)