From 40dde675bab7a8242a0042d38ca1b287a17836ea Mon Sep 17 00:00:00 2001 From: MatthieuMeo Date: Thu, 4 Mar 2021 14:41:20 +0100 Subject: [PATCH] Refactor module tessellation to graph. Refactor package name to pycgsp. --- doc/.DS_Store | Bin 14340 -> 14340 bytes doc/api/.DS_Store | Bin 6148 -> 10244 bytes doc/api/{tessellations => graphs}/index.rst | 2 +- doc/api/index.rst | 4 ++-- doc/api/operators/index.rst | 6 +++--- ...p.linop.base.rst => pycgsp.linop.base.rst} | 2 +- ...p.linop.conv.rst => pycgsp.linop.conv.rst} | 2 +- ...p.linop.diff.rst => pycgsp.linop.diff.rst} | 2 +- doc/conf.py | 5 +++-- doc/index.rst | 8 ++++---- {pycsou_gsp => pycgsp}/__init__.py | 0 .../tessellation => pycgsp/graph}/__init__.py | 4 ++-- pycgsp/linop/__init__.py | 1 + {pycsou_gsp => pycgsp}/linop/base.py | 2 +- {pycsou_gsp => pycgsp}/linop/conv.py | 8 ++++---- {pycsou_gsp => pycgsp}/linop/diff.py | 18 +++++++++--------- pycsou_gsp/linop/__init__.py | 1 - setup.cfg | 4 ++-- 18 files changed, 35 insertions(+), 34 deletions(-) rename doc/api/{tessellations => graphs}/index.rst (73%) rename doc/api/operators/{pycsou_gsp.linop.base.rst => pycgsp.linop.base.rst} (74%) rename doc/api/operators/{pycsou_gsp.linop.conv.rst => pycgsp.linop.conv.rst} (82%) rename doc/api/operators/{pycsou_gsp.linop.diff.rst => pycgsp.linop.diff.rst} (85%) rename {pycsou_gsp => pycgsp}/__init__.py (100%) rename {pycsou_gsp/tessellation => pycgsp/graph}/__init__.py (98%) create mode 100644 pycgsp/linop/__init__.py rename {pycsou_gsp => pycgsp}/linop/base.py (97%) rename {pycsou_gsp => pycgsp}/linop/conv.py (94%) rename {pycsou_gsp => pycgsp}/linop/diff.py (94%) delete mode 100644 pycsou_gsp/linop/__init__.py diff --git a/doc/.DS_Store b/doc/.DS_Store index 63cd8fafeb162da93c942b55dace78f187228487..5e53118ece22ea458954dc0f02d7823c8b13cdf1 100644 GIT binary patch delta 129 zcmZoEXerpBsK9t)@<#Cn4e{z~3sW5h6Z2Xfg=#|s3lkj$a|5&5T22meRYP0Pgxt!i z>YCcR8I#W{$TQBI{8mAmNr!K9AMzGa=Pq%JgBOkIbuVY9RP2KLS0^w`-Z T3yAh?Zd0veL`Y6{R^JBzYGoIG diff --git a/doc/api/.DS_Store b/doc/api/.DS_Store index 34c14fcb90ec02aa3166728fad91ce33116dc59f..35bc05b40062debfb1277c8576412e17e4411e2a 100644 GIT binary patch literal 10244 zcmeHMeQX@X6`!|uoZV)E$8Li6Y{$ODNeEz@yOLm&ko00Zu^lH(h`*h*=FYpZ7uL7t zcJG`ILXBvlA0W{JRr!bT(F&;`)GDNEr9xFoE2IjwR8}g|5Bf)FQU7Q~32OO@cr&wi zxjUarKh!9ScBI`m^X9$TnRoBK-^?5#1Uk}2l#nnXM8$_wM)6gm@P7U*D2mTvNCEW; znIdjt)}2Y%PGW&{zz8f5SRk-KV1d8_fdwuF3m|6mqArs(cn1~;ED%^AX91oc!uW6+ z^XZ(VB6Z+P908D)BU==#^Wy;53HvnW(>Y182Mb75q*4|9BL+xy1}|;@(ukuMaqmovX(aLzX!^&Q^3fNiS|C&6H5K z3=>5T4qHjXneA}WNy8Q6^ve$Mp>bAo>{$Dz=J3Y0SzS<~XZ#(G0!V+?O&lxa8pp$4*Zt-Emem5w|DOcHA?!+cp=iZjtJhs~-NqZYb?ofhJ73AFswrK0<#5Jwt%Plk#@z`sX;{h0 z!CA}jrpD0zNzXcDnJGH*%@nKJQh2!-`m>2$zF8?ZPE@*%EmrgY#o^aJKQA|?9p}?GoRJF@nwz&!eFT5TX`HcJ1cEi9KRaUWTy+_}rvR|uX?o>Qw?wv&s&GJ8^s^WJ=J|Am`VR=rjb3gB7 zRx)E@AfU}&@d4aq_PLn^7 zH_2bgyW~CcKKT$7SOyf9LnY|28d@O&QTP;Wftz3}^um4^hEW)U17Ls!w}B1Qkbyhk z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PKG-INFO" + info_path = sphinx_src_dir / ".." / "pycgsp.egg-info" / "PKG-INFO" info_path = info_path.resolve(strict=True) # Pattern definitions @@ -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 ------------------------------------------ diff --git a/doc/index.rst b/doc/index.rst index 21bb74b..cfb2ae6 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -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:: diff --git a/pycsou_gsp/__init__.py b/pycgsp/__init__.py similarity index 100% rename from pycsou_gsp/__init__.py rename to pycgsp/__init__.py diff --git a/pycsou_gsp/tessellation/__init__.py b/pycgsp/graph/__init__.py similarity index 98% rename from pycsou_gsp/tessellation/__init__.py rename to pycgsp/graph/__init__.py index e24a4f9..77c7aff 100644 --- a/pycsou_gsp/tessellation/__init__.py +++ b/pycgsp/graph/__init__.py @@ -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) @@ -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) diff --git a/pycgsp/linop/__init__.py b/pycgsp/linop/__init__.py new file mode 100644 index 0000000..ecbc2f6 --- /dev/null +++ b/pycgsp/linop/__init__.py @@ -0,0 +1 @@ +from pycgsp.linop import * diff --git a/pycsou_gsp/linop/base.py b/pycgsp/linop/base.py similarity index 97% rename from pycsou_gsp/linop/base.py rename to pycgsp/linop/base.py index 9557af0..dfc8f1e 100644 --- a/pycsou_gsp/linop/base.py +++ b/pycgsp/linop/base.py @@ -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) diff --git a/pycsou_gsp/linop/conv.py b/pycgsp/linop/conv.py similarity index 94% rename from pycsou_gsp/linop/conv.py rename to pycgsp/linop/conv.py index 5bdae4c..0c4c63e 100644 --- a/pycsou_gsp/linop/conv.py +++ b/pycgsp/linop/conv.py @@ -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): @@ -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:: @@ -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') @@ -86,7 +86,7 @@ class GraphConvolution(PolynomialLinearOperator): See Also -------- - :py:class:`~pycsou_gsp.linop.diff.GraphLaplacian` + :py:class:`~pycgsp.linop.diff.GraphLaplacian` """ diff --git a/pycsou_gsp/linop/diff.py b/pycgsp/linop/diff.py similarity index 94% rename from pycsou_gsp/linop/diff.py rename to pycgsp/linop/diff.py index b877a04..2bfb413 100644 --- a/pycsou_gsp/linop/diff.py +++ b/pycgsp/linop/diff.py @@ -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): @@ -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') @@ -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` """ @@ -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:: @@ -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` """ @@ -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``: @@ -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') @@ -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` """ diff --git a/pycsou_gsp/linop/__init__.py b/pycsou_gsp/linop/__init__.py deleted file mode 100644 index 8fbf22f..0000000 --- a/pycsou_gsp/linop/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from pycsou_gsp.linop import * diff --git a/setup.cfg b/setup.cfg index 5d7a4e5..93cfd32 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 @@ -29,4 +29,4 @@ warning-is-error = True [files] packages = - pycsou_gsp \ No newline at end of file + pycgsp \ No newline at end of file