Skip to content

Commit d859915

Browse files
committed
Merge branch 'master' into polynomial-approximations
Get the plotting updates.
2 parents cb6cbd1 + 50277b3 commit d859915

File tree

14 files changed

+259
-205
lines changed

14 files changed

+259
-205
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://lts2.epfl.ch/gsp>`_ exists.)
40+
A (mostly unmaintained) `Matlab version <https://lts2.epfl.ch/gsp>`_ 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+
}

doc/history.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
History
33
=======
44

5-
0.6.0 (2018-03-xx)
5+
0.6.0 (2018-04-xx)
66
------------------
77

88
Filters approximated by Chebyshev polynomials are now implemented as separate
@@ -22,6 +22,17 @@ order 10. The reasons are multiple:
2222

2323
See the new tutorial on filter approximations for usage.
2424

25+
The plotting interface was updated to be more user-friendly. First, the
26+
documentation is now shown for filters.plot(), G.plot(), and co. Second, the
27+
API in the plotting library has been deprecated. That module is now mostly for
28+
implementation only. Finally, the following parameter names were changed:
29+
* plot_name => title
30+
* plot_eigenvalues => eigenvalues
31+
* show_sum => sum
32+
* show_edges => edges
33+
* npoints => n
34+
* save_as => save
35+
2536
0.5.1 (2017-12-15)
2637
------------------
2738

doc/tutorials/intro.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ let's define and plot that low-pass filter:
193193
>>> g = filters.Filter(G, g)
194194
>>>
195195
>>> fig, ax = plt.subplots()
196-
>>> g.plot(plot_eigenvalues=True, ax=ax)
196+
>>> g.plot(eigenvalues=True, ax=ax)
197197
>>> _ = ax.set_title('Filter frequency response')
198198

199199
The filter is plotted along all the spectrum of the graph. The black crosses

pygsp/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,20 @@
3030

3131
_utils.import_modules(__all__[::-1], 'pygsp', 'pygsp')
3232

33+
# Users only call the plot methods from the objects.
34+
# It's thus more convenient for them to have the doc there.
35+
# But it's more convenient for developers to have the doc alongside the code.
36+
try:
37+
filters.Filter.plot.__doc__ = plotting._plot_filter.__doc__
38+
graphs.Graph.plot.__doc__ = plotting._plot_graph.__doc__
39+
graphs.Graph.plot_signal.__doc__ = plotting._plot_signal.__doc__
40+
graphs.Graph.plot_spectrogram.__doc__ = plotting._plot_spectrogram.__doc__
41+
except AttributeError:
42+
# For Python 2.7.
43+
filters.Filter.plot.__func__.__doc__ = plotting._plot_filter.__doc__
44+
graphs.Graph.plot.__func__.__doc__ = plotting._plot_graph.__doc__
45+
graphs.Graph.plot_signal.__func__.__doc__ = plotting._plot_signal.__doc__
46+
graphs.Graph.plot_spectrogram.__func__.__doc__ = plotting._plot_spectrogram.__doc__
47+
3348
__version__ = '0.5.1'
3449
__release_date__ = '2017-12-15'
20.4 KB
Loading
File renamed without changes.

pygsp/filters/filter.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,9 @@ def can_dual_func(g, n, x):
533533

534534
return Filter(self.G, kernels)
535535

536-
def plot(self, **kwargs):
537-
r"""Plot the filter bank's frequency response.
538-
539-
See :func:`pygsp.plotting.plot_filter`.
540-
"""
541-
from pygsp import plotting
542-
plotting.plot_filter(self, **kwargs)
536+
def plot(self, n=500, eigenvalues=None, sum=None, title='', save=None,
537+
ax=None, **kwargs):
538+
r"""Docstring overloaded at import time."""
539+
from pygsp.plotting import _plot_filter
540+
_plot_filter(self, n=n, eigenvalues=eigenvalues, sum=sum, title=title,
541+
save=save, ax=ax, **kwargs)

pygsp/graphs/airfoil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Airfoil(Graph):
1616
>>> G = graphs.Airfoil()
1717
>>> fig, axes = plt.subplots(1, 2)
1818
>>> _ = axes[0].spy(G.W, markersize=0.5)
19-
>>> G.plot(show_edges=True, ax=axes[1])
19+
>>> G.plot(edges=True, ax=axes[1])
2020
2121
"""
2222

0 commit comments

Comments
 (0)