Skip to content

Commit

Permalink
Refactor module tessellation to graph. Refactor package name to pycgsp.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieumeo committed Mar 4, 2021
1 parent 5f263ad commit 40dde67
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 34 deletions.
Binary file modified doc/.DS_Store
Binary file not shown.
Binary file modified doc/api/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Tessellation Graphs
===================

.. automodule:: pycsou_gsp.tessellation.__init__
.. automodule:: pycgsp.graph.__init__
:special-members: __init__

.. autosummary::
Expand Down
4 changes: 2 additions & 2 deletions doc/api/index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Pycsou-gsp API
Pycsou-GSP API
##############

.. toctree::
:maxdepth: 1
:hidden:

operators/index
tessellations/index
graphs/index
6 changes: 3 additions & 3 deletions doc/api/operators/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Linear Operators
.. autosummary::
:toctree:

pycsou_gsp.linop.base
pycsou_gsp.linop.conv
pycsou_gsp.linop.diff
pycgsp.linop.base
pycgsp.linop.conv
pycgsp.linop.diff
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Polynomial Filter

Base class for polynomial graph filters.

.. automodule:: pycsou_gsp.linop.base
.. automodule:: pycgsp.linop.base
:special-members: __init__
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Convolution Operators

Base class for graph convolution operators.

.. automodule:: pycsou_gsp.linop.conv
.. automodule:: pycgsp.linop.conv
:special-members: __init__

.. autosummary::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Differential Operators

Base class for graph convolution operators.

.. automodule:: pycsou_gsp.linop.diff
.. automodule:: pycgsp.linop.diff
:special-members: __init__

.. autosummary::
Expand Down
5 changes: 3 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def pkg_info() -> Mapping:
Load information contained in `PKG-INFO`.
"""
sphinx_src_dir = pathlib.Path(__file__).parent
info_path = sphinx_src_dir / ".." / "pycsou_gsp.egg-info" / "PKG-INFO"
info_path = sphinx_src_dir / ".." / "pycgsp.egg-info" / "PKG-INFO"
info_path = info_path.resolve(strict=True)

# Pattern definitions
Expand Down Expand Up @@ -105,7 +105,8 @@ def pkg_info() -> Mapping:
"pylops [latest]": ("https://pylops.readthedocs.io/en/latest", None),
"dask [latest]": ("https://docs.dask.org/en/latest/", None),
"pandas": ("http://pandas.pydata.org/pandas-docs/stable/", None),
"matplotlib": ("https://matplotlib.org/", None)
"matplotlib": ("https://matplotlib.org/", None),
"pycsou": ("https://matthieumeo.github.io/pycsou/html/", None)
}

# -- Options for napoleon extension ------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Content

The package is organised as follows:

1. The subpackage ``pycsou_gsp.linop`` implements the following common graph linear operators:
1. The subpackage ``pycgsp.linop`` implements the following common graph linear operators:

* Graph convolution operators: :py:class:`~pycsou_gsp.linop.conv.GraphConvolution`
* Graph differential operators: :py:class:`~pycsou_gsp.linop.diff.GraphLaplacian`, :py:class:`~pycsou_gsp.linop.diff.GraphGradient`, :py:class:`~pycsou_gsp.linop.diff.GeneralisedGraphLaplacian`.
* Graph convolution operators: :py:class:`~pycgsp.linop.conv.GraphConvolution`
* Graph differential operators: :py:class:`~pycgsp.linop.diff.GraphLaplacian`, :py:class:`~pycgsp.linop.diff.GraphGradient`, :py:class:`~pycgsp.linop.diff.GeneralisedGraphLaplacian`.

2. The subpackage ``pycsou_gsp.tesselation`` provides routines for generating graphs from discrete tessellations of continuous manifolds such as the sphere.
2. The subpackage ``pycgsp.graph`` provides routines for generating graphs from discrete tessellations of continuous manifolds such as the sphere.


.. toctree::
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def cvxhull_graph(R: np.ndarray, cheb_normalized: bool = True, compute_different
.. plot::
import numpy as np
from pycsou_gsp.tessellation import cvxhull_graph
from pycgsp.graph import cvxhull_graph
from pygsp.plotting import plot_graph
theta, phi = np.linspace(0,np.pi,6, endpoint=False)[1:], np.linspace(0,2*np.pi,9, endpoint=False)
theta, phi = np.meshgrid(theta, phi)
Expand Down Expand Up @@ -153,7 +153,7 @@ def healpix_nngraph(nside: int, cheb_normalized: bool = True, compute_differenti
.. plot::
from pycsou_gsp.tessellation import healpix_nngraph
from pycgsp.graph import healpix_nngraph
from pygsp.plotting import plot_graph
G, _ = healpix_nngraph(nside=2)
plot_graph(G)
Expand Down
1 change: 1 addition & 0 deletions pycgsp/linop/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from pycgsp.linop import *
2 changes: 1 addition & 1 deletion pycsou_gsp/linop/base.py → pycgsp/linop/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class PolynomialLinearOperator(LinearOperator):
.. doctest::
>>> from pycsou.linop import DenseLinearOperator
>>> from pycsou_gsp.linop.base import PolynomialLinearOperator
>>> from pycgsp.linop.base import PolynomialLinearOperator
>>> L = DenseLinearOperator(np.arange(64).reshape(8,8))
>>> PL = PolynomialLinearOperator(LinOp=L, coeffs=[1/2 ,2, 1])
>>> x = np.arange(8)
Expand Down
8 changes: 4 additions & 4 deletions pycsou_gsp/linop/conv.py → pycgsp/linop/conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import pygsp

from pycsou.linop.base import SparseLinearOperator
from pycsou_gsp.linop.base import PolynomialLinearOperator
from pycgsp.linop.base import PolynomialLinearOperator


class GraphConvolution(PolynomialLinearOperator):
Expand All @@ -36,7 +36,7 @@ class GraphConvolution(PolynomialLinearOperator):
import numpy as np
from pygsp.graphs import RandomRegular
from pycsou_gsp.linop.conv import GraphConvolution
from pycgsp.linop.conv import GraphConvolution
np.random.seed(0)
.. doctest::
Expand All @@ -52,7 +52,7 @@ class GraphConvolution(PolynomialLinearOperator):
import numpy as np
from pygsp.graphs import Ring
from pycsou_gsp.linop.conv import GraphConvolution
from pycgsp.linop.conv import GraphConvolution
np.random.seed(0)
G = Ring(N=32, k=2)
G.compute_laplacian(lap_type='normalized')
Expand Down Expand Up @@ -86,7 +86,7 @@ class GraphConvolution(PolynomialLinearOperator):
See Also
--------
:py:class:`~pycsou_gsp.linop.diff.GraphLaplacian`
:py:class:`~pycgsp.linop.diff.GraphLaplacian`
"""

Expand Down
18 changes: 9 additions & 9 deletions pycsou_gsp/linop/diff.py → pycgsp/linop/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from pycsou.core.linop import LinearOperator
from pycsou.linop.base import SparseLinearOperator, IdentityOperator
from pycsou_gsp.linop.base import PolynomialLinearOperator
from pycgsp.linop.base import PolynomialLinearOperator


class GraphLaplacian(LinearOperator):
Expand All @@ -29,7 +29,7 @@ class GraphLaplacian(LinearOperator):
import numpy as np
from pygsp.graphs import Ring
from pycsou_gsp.linop.diff import GraphLaplacian
from pycgsp.linop.diff import GraphLaplacian
np.random.seed(1)
G = Ring(N=32, k=4)
G.compute_laplacian(lap_type='normalized')
Expand Down Expand Up @@ -77,8 +77,8 @@ class GraphLaplacian(LinearOperator):
See Also
--------
:py:class:`~pycsou_gsp.linop.diff.GraphGradient`, :py:func:`~pycsou_gsp.linop.diff.GeneralisedGraphLaplacian`
:py:class:`~pycsou_gsp.linop.conv.GraphConvolution`
:py:class:`~pycgsp.linop.diff.GraphGradient`, :py:func:`~pycgsp.linop.diff.GeneralisedGraphLaplacian`
:py:class:`~pycgsp.linop.conv.GraphConvolution`
"""

Expand Down Expand Up @@ -131,7 +131,7 @@ class GraphGradient(LinearOperator):
import numpy as np
from pygsp.graphs import Ring
from pycsou_gsp.linop.diff import GraphLaplacian, GraphGradient
from pycgsp.linop.diff import GraphLaplacian, GraphGradient
np.random.seed(1)
.. doctest::
Expand Down Expand Up @@ -160,7 +160,7 @@ class GraphGradient(LinearOperator):
See Also
--------
:py:class:`~pycsou_gsp.linop.diff.GraphLaplacian`, :py:func:`~pycsou_gsp.linop.diff.GeneralisedGraphLaplacian`
:py:class:`~pycgsp.linop.diff.GraphLaplacian`, :py:func:`~pycgsp.linop.diff.GeneralisedGraphLaplacian`
"""

Expand Down Expand Up @@ -215,7 +215,7 @@ def GeneralisedGraphLaplacian(Graph: pygsp.graphs.Graph, kind: str = 'iterated',
* ``'sobolev'``: :math:`\mathscr{D}=(\alpha^2 \mathrm{Id}-\mathbf{L})^N`, with :math:`\alpha\in\mathbb{R}`,
* ``'polynomial'``: :math:`\mathscr{D}=\sum_{n=0}^N \alpha_n \mathbf{L}^n`, with :math:`\{\alpha_0,\ldots,\alpha_N\} \subset\mathbb{R}`,
where :math:`\mathbf{L}` is the :py:func:`~pycsou.linop.diff.GraphLaplacian` operator.
where :math:`\mathbf{L}` is the :py:class:`~pycgsp.linop.diff.GraphLaplacian` operator.
kwargs: Any
Additional arguments depending on the value of ``kind``:
Expand All @@ -239,7 +239,7 @@ def GeneralisedGraphLaplacian(Graph: pygsp.graphs.Graph, kind: str = 'iterated',
import numpy as np
from pygsp.graphs import Ring
from pycsou_gsp.linop.diff import GeneralisedGraphLaplacian
from pycgsp.linop.diff import GeneralisedGraphLaplacian
np.random.seed(1)
G = Ring(N=32, k=4)
G.compute_laplacian(lap_type='normalized')
Expand All @@ -266,7 +266,7 @@ def GeneralisedGraphLaplacian(Graph: pygsp.graphs.Graph, kind: str = 'iterated',
See Also
--------
:py:class:`~pycsou_gsp.linop.diff.GraphLaplacian`
:py:class:`~pycgsp.linop.diff.GraphLaplacian`
"""
Expand Down
1 change: 0 additions & 1 deletion pycsou_gsp/linop/__init__.py

This file was deleted.

4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
name = pycsou_gsp
name = pycgsp
summary = Graph signal processing extensions for Pycsou.
long_description = file:README.rst
long_description_content_type = text/x-rst; charset=UTF-8
Expand Down Expand Up @@ -29,4 +29,4 @@ warning-is-error = True

[files]
packages =
pycsou_gsp
pycgsp

0 comments on commit 40dde67

Please sign in to comment.