diff --git a/pygsp/filters/abspline.py b/pygsp/filters/abspline.py index 2bd23e33..8766823b 100644 --- a/pygsp/filters/abspline.py +++ b/pygsp/filters/abspline.py @@ -35,6 +35,8 @@ class Abspline(Filter): >>> G.estimate_lmax() >>> G.set_coordinates('line1D') >>> g = filters.Abspline(G) + >>> g + Abspline(in=1, out=6, lpfactor=20.00) >>> s = g.localize(G.N // 2) >>> fig, axes = plt.subplots(1, 2) >>> _ = g.plot(ax=axes[0]) diff --git a/pygsp/filters/expwin.py b/pygsp/filters/expwin.py index 3152d7f2..2196c879 100644 --- a/pygsp/filters/expwin.py +++ b/pygsp/filters/expwin.py @@ -37,6 +37,8 @@ class Expwin(Filter): >>> G.estimate_lmax() >>> G.set_coordinates('line1D') >>> g = filters.Expwin(G, band_min=0.1, band_max=0.7, slope=5) + >>> g + Expwin(in=1, out=1, band_min=0.10, band_max=0.70, slope=5) >>> s = g.localize(G.N // 2) >>> fig, axes = plt.subplots(1, 2) >>> _ = g.plot(ax=axes[0]) diff --git a/pygsp/filters/filter.py b/pygsp/filters/filter.py index d4561232..1024b82d 100644 --- a/pygsp/filters/filter.py +++ b/pygsp/filters/filter.py @@ -45,6 +45,8 @@ class Filter(object): -------- >>> G = graphs.Logo() >>> my_filter = filters.Filter(G, lambda x: x / (1. + x)) + >>> my_filter + Filter(in=1, out=1) >>> >>> # Signal: Kronecker delta. >>> signal = np.zeros(G.N) diff --git a/pygsp/filters/gabor.py b/pygsp/filters/gabor.py index 6b1a8883..0566cf8c 100644 --- a/pygsp/filters/gabor.py +++ b/pygsp/filters/gabor.py @@ -67,6 +67,8 @@ class Gabor(Filter): ... _ = g.plot(ax=ax[0], sum=False) ... _ = G.plot(s, ax=ax[1]) >>> fig.tight_layout() + >>> g + Gabor(in=1, out=7) """ diff --git a/pygsp/filters/halfcosine.py b/pygsp/filters/halfcosine.py index 253793e6..d8cd5ac6 100644 --- a/pygsp/filters/halfcosine.py +++ b/pygsp/filters/halfcosine.py @@ -26,6 +26,8 @@ class HalfCosine(Filter): >>> G.estimate_lmax() >>> G.set_coordinates('line1D') >>> g = filters.HalfCosine(G) + >>> g + HalfCosine(in=1, out=6) >>> s = g.localize(G.N // 2) >>> fig, axes = plt.subplots(1, 2) >>> _ = g.plot(ax=axes[0]) diff --git a/pygsp/filters/heat.py b/pygsp/filters/heat.py index df402de8..c6311736 100644 --- a/pygsp/filters/heat.py +++ b/pygsp/filters/heat.py @@ -59,6 +59,8 @@ class Heat(Filter): >>> G.estimate_lmax() >>> G.set_coordinates('line1D') >>> g = filters.Heat(G, scale=[5, 10, 100]) + >>> g + Heat(in=1, out=3, scale=[5.00, 10.00, 100.00], normalize=False) >>> s = g.localize(G.N // 2) >>> fig, axes = plt.subplots(1, 2) >>> _ = g.plot(ax=axes[0]) diff --git a/pygsp/filters/held.py b/pygsp/filters/held.py index 709cdf3e..c185fdbf 100644 --- a/pygsp/filters/held.py +++ b/pygsp/filters/held.py @@ -40,6 +40,8 @@ class Held(Filter): >>> G.estimate_lmax() >>> G.set_coordinates('line1D') >>> g = filters.Held(G) + >>> g + Held(in=1, out=2, a=0.67) >>> s = g.localize(G.N // 2) >>> fig, axes = plt.subplots(1, 2) >>> _ = g.plot(ax=axes[0]) diff --git a/pygsp/filters/itersine.py b/pygsp/filters/itersine.py index 05853544..d4faeacb 100644 --- a/pygsp/filters/itersine.py +++ b/pygsp/filters/itersine.py @@ -31,6 +31,8 @@ class Itersine(Filter): >>> G.estimate_lmax() >>> G.set_coordinates('line1D') >>> g = filters.Itersine(G) + >>> g + Itersine(in=1, out=6, overlap=2.00) >>> s = g.localize(G.N // 2) >>> fig, axes = plt.subplots(1, 2) >>> _ = g.plot(ax=axes[0]) diff --git a/pygsp/filters/mexicanhat.py b/pygsp/filters/mexicanhat.py index e0c43c56..d26dad73 100644 --- a/pygsp/filters/mexicanhat.py +++ b/pygsp/filters/mexicanhat.py @@ -48,6 +48,8 @@ class MexicanHat(Filter): >>> G.estimate_lmax() >>> G.set_coordinates('line1D') >>> g = filters.MexicanHat(G) + >>> g + MexicanHat(in=1, out=6, lpfactor=20.00, normalize=False) >>> s = g.localize(G.N // 2) >>> fig, axes = plt.subplots(1, 2) >>> _ = g.plot(ax=axes[0]) diff --git a/pygsp/filters/meyer.py b/pygsp/filters/meyer.py index e54f5314..6b79067a 100644 --- a/pygsp/filters/meyer.py +++ b/pygsp/filters/meyer.py @@ -32,6 +32,8 @@ class Meyer(Filter): >>> G.estimate_lmax() >>> G.set_coordinates('line1D') >>> g = filters.Meyer(G) + >>> g + Meyer(in=1, out=6) >>> s = g.localize(G.N // 2) >>> fig, axes = plt.subplots(1, 2) >>> _ = g.plot(ax=axes[0]) diff --git a/pygsp/filters/modulation.py b/pygsp/filters/modulation.py index 60833850..58576d23 100644 --- a/pygsp/filters/modulation.py +++ b/pygsp/filters/modulation.py @@ -88,6 +88,8 @@ class Modulation(Filter): >>> g1 = filters.Modulation(G, g, modulation_first=False) >>> g2 = filters.Modulation(G, g, modulation_first=True) >>> _ = g1.plot(sum=False) + >>> g1 + Modulation(in=1, out=90) >>> >>> # Signal. >>> s = np.empty(G.N) diff --git a/pygsp/filters/papadakis.py b/pygsp/filters/papadakis.py index 68a97ace..5a60fc50 100644 --- a/pygsp/filters/papadakis.py +++ b/pygsp/filters/papadakis.py @@ -36,6 +36,8 @@ class Papadakis(Filter): >>> G.estimate_lmax() >>> G.set_coordinates('line1D') >>> g = filters.Papadakis(G) + >>> g + Papadakis(in=1, out=2, a=0.75) >>> s = g.localize(G.N // 2) >>> fig, axes = plt.subplots(1, 2) >>> _ = g.plot(ax=axes[0]) diff --git a/pygsp/filters/rectangular.py b/pygsp/filters/rectangular.py index 24abed64..617a2d9e 100644 --- a/pygsp/filters/rectangular.py +++ b/pygsp/filters/rectangular.py @@ -48,6 +48,8 @@ class Rectangular(Filter): >>> G.estimate_lmax() >>> G.set_coordinates('line1D') >>> g = filters.Rectangular(G, band_min=0.1, band_max=0.5) + >>> g + Rectangular(in=1, out=1, band_min=0.10, band_max=0.50) >>> s = g.localize(G.N // 2) >>> fig, axes = plt.subplots(1, 2) >>> _ = g.plot(ax=axes[0]) diff --git a/pygsp/filters/regular.py b/pygsp/filters/regular.py index 6640b948..fd51f19c 100644 --- a/pygsp/filters/regular.py +++ b/pygsp/filters/regular.py @@ -44,6 +44,8 @@ class Regular(Filter): >>> G.estimate_lmax() >>> G.set_coordinates('line1D') >>> g = filters.Regular(G) + >>> g + Regular(in=1, out=2) >>> s = g.localize(G.N // 2) >>> fig, axes = plt.subplots(1, 2) >>> _ = g.plot(ax=axes[0]) diff --git a/pygsp/filters/simoncelli.py b/pygsp/filters/simoncelli.py index 9ad60cc7..e8b3ad48 100644 --- a/pygsp/filters/simoncelli.py +++ b/pygsp/filters/simoncelli.py @@ -36,6 +36,8 @@ class Simoncelli(Filter): >>> G.estimate_lmax() >>> G.set_coordinates('line1D') >>> g = filters.Simoncelli(G) + >>> g + Simoncelli(in=1, out=2, a=0.67) >>> s = g.localize(G.N // 2) >>> fig, axes = plt.subplots(1, 2) >>> _ = g.plot(ax=axes[0]) diff --git a/pygsp/filters/simpletight.py b/pygsp/filters/simpletight.py index 32b2989e..4dcb323b 100644 --- a/pygsp/filters/simpletight.py +++ b/pygsp/filters/simpletight.py @@ -32,6 +32,8 @@ class SimpleTight(Filter): >>> G.estimate_lmax() >>> G.set_coordinates('line1D') >>> g = filters.SimpleTight(G) + >>> g + SimpleTight(in=1, out=6) >>> s = g.localize(G.N // 2) >>> fig, axes = plt.subplots(1, 2) >>> _ = g.plot(ax=axes[0]) diff --git a/pygsp/filters/wave.py b/pygsp/filters/wave.py index 551e1b4e..f9b28390 100644 --- a/pygsp/filters/wave.py +++ b/pygsp/filters/wave.py @@ -62,6 +62,8 @@ class Wave(Filter): >>> G.estimate_lmax() >>> G.set_coordinates('line1D') >>> g = filters.Wave(G, time=[5, 15], speed=1) + >>> g + Wave(in=1, out=2, time=[5.00, 15.00], speed=[1.00]) >>> s = g.localize(G.N // 2) >>> fig, axes = plt.subplots(1, 2) >>> _ = g.plot(ax=axes[0]) diff --git a/pygsp/graphs/airfoil.py b/pygsp/graphs/airfoil.py index 0bbc8140..7a64ae8c 100644 --- a/pygsp/graphs/airfoil.py +++ b/pygsp/graphs/airfoil.py @@ -14,6 +14,8 @@ class Airfoil(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.Airfoil() + >>> G + Airfoil(n_vertices=4253, n_edges=12289) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=0.5) >>> _ = G.plot(edges=True, ax=axes[1]) diff --git a/pygsp/graphs/barabasialbert.py b/pygsp/graphs/barabasialbert.py index 0f2a11bb..e05ec3de 100644 --- a/pygsp/graphs/barabasialbert.py +++ b/pygsp/graphs/barabasialbert.py @@ -35,6 +35,8 @@ class BarabasiAlbert(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.BarabasiAlbert(N=150, seed=42) + >>> G + BarabasiAlbert(n_vertices=150, n_edges=149, m0=1, m=1, seed=42) >>> G.set_coordinates(kind='spring', seed=42) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=2) diff --git a/pygsp/graphs/comet.py b/pygsp/graphs/comet.py index b716b1d1..23a95bd1 100644 --- a/pygsp/graphs/comet.py +++ b/pygsp/graphs/comet.py @@ -22,6 +22,8 @@ class Comet(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.Comet(15, 10) + >>> G + Comet(n_vertices=15, n_edges=14, k=10) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W) >>> _ = G.plot(ax=axes[1]) diff --git a/pygsp/graphs/community.py b/pygsp/graphs/community.py index b10cf4d4..2130eb3d 100644 --- a/pygsp/graphs/community.py +++ b/pygsp/graphs/community.py @@ -53,6 +53,8 @@ class Community(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.Community(N=250, Nc=3, comm_sizes=[50, 120, 80], seed=42) + >>> G # doctest: +ELLIPSIS + Community(n_vertices=250, n_edges=1607, Nc=3, min_comm=28, ..., seed=42) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=0.5) >>> _ = G.plot(ax=axes[1]) diff --git a/pygsp/graphs/davidsensornet.py b/pygsp/graphs/davidsensornet.py index 84a3d9c9..6d1ff874 100644 --- a/pygsp/graphs/davidsensornet.py +++ b/pygsp/graphs/davidsensornet.py @@ -22,6 +22,8 @@ class DavidSensorNet(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.DavidSensorNet() + >>> G + DavidSensorNet(n_vertices=64, n_edges=236, seed=None) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=2) >>> _ = G.plot(ax=axes[1]) diff --git a/pygsp/graphs/erdosrenyi.py b/pygsp/graphs/erdosrenyi.py index b4dbe528..9c072811 100644 --- a/pygsp/graphs/erdosrenyi.py +++ b/pygsp/graphs/erdosrenyi.py @@ -32,6 +32,8 @@ class ErdosRenyi(StochasticBlockModel): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.ErdosRenyi(N=64, seed=42) + >>> G # doctest: +ELLIPSIS + ErdosRenyi(n_vertices=64, n_edges=219, k=1, p=0.10, q=0.30, ..., seed=42) >>> G.set_coordinates(kind='spring', seed=42) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=2) diff --git a/pygsp/graphs/fullconnected.py b/pygsp/graphs/fullconnected.py index 0f4c1dee..75d4aaf5 100644 --- a/pygsp/graphs/fullconnected.py +++ b/pygsp/graphs/fullconnected.py @@ -19,6 +19,8 @@ class FullConnected(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.FullConnected(N=20) + >>> G + FullConnected(n_vertices=20, n_edges=190) >>> G.set_coordinates(kind='spring', seed=42) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=5) diff --git a/pygsp/graphs/grid2d.py b/pygsp/graphs/grid2d.py index 26bef79b..a48fbb8a 100644 --- a/pygsp/graphs/grid2d.py +++ b/pygsp/graphs/grid2d.py @@ -32,6 +32,8 @@ class Grid2d(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.Grid2d(N1=5, N2=4) + >>> G + Grid2d(n_vertices=20, n_edges=31, N1=5, N2=4) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W) >>> _ = G.plot(ax=axes[1]) diff --git a/pygsp/graphs/linegraph.py b/pygsp/graphs/linegraph.py index 59877370..d41c0538 100644 --- a/pygsp/graphs/linegraph.py +++ b/pygsp/graphs/linegraph.py @@ -25,7 +25,11 @@ class LineGraph(Graph): -------- >>> import matplotlib.pyplot as plt >>> graph = graphs.Sensor(5, k=2, seed=10) + >>> graph + Sensor(n_vertices=5, n_edges=6, k=2, distributed=False, seed=10) >>> line_graph = graphs.LineGraph(graph) + >>> line_graph + LineGraph(n_vertices=6, n_edges=10) >>> fig, ax = plt.subplots() >>> fig, ax = graph.plot('blue', edge_color='blue', indices=True, ax=ax) >>> fig, ax = line_graph.plot('red', edge_color='red', indices=True, ax=ax) diff --git a/pygsp/graphs/logo.py b/pygsp/graphs/logo.py index 8d2c47e2..1a377213 100644 --- a/pygsp/graphs/logo.py +++ b/pygsp/graphs/logo.py @@ -13,6 +13,8 @@ class Logo(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.Logo() + >>> G + Logo(n_vertices=1130, n_edges=3131) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=0.5) >>> _ = G.plot(ax=axes[1]) diff --git a/pygsp/graphs/lowstretchtree.py b/pygsp/graphs/lowstretchtree.py index a55de736..c3c69da2 100644 --- a/pygsp/graphs/lowstretchtree.py +++ b/pygsp/graphs/lowstretchtree.py @@ -22,6 +22,8 @@ class LowStretchTree(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.LowStretchTree(k=2) + >>> G + LowStretchTree(n_vertices=16, n_edges=30, k=2) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W) >>> _ = G.plot(ax=axes[1]) diff --git a/pygsp/graphs/minnesota.py b/pygsp/graphs/minnesota.py index 6e429c8e..93653e39 100644 --- a/pygsp/graphs/minnesota.py +++ b/pygsp/graphs/minnesota.py @@ -25,6 +25,8 @@ class Minnesota(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.Minnesota() + >>> G + Minnesota(n_vertices=2642, n_edges=3304, connected=True) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=0.5) >>> _ = G.plot(ax=axes[1]) diff --git a/pygsp/graphs/nngraphs/bunny.py b/pygsp/graphs/nngraphs/bunny.py index d9dac407..3c044f77 100644 --- a/pygsp/graphs/nngraphs/bunny.py +++ b/pygsp/graphs/nngraphs/bunny.py @@ -15,6 +15,8 @@ class Bunny(NNGraph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.Bunny() + >>> G # doctest: +ELLIPSIS + Bunny(n_vertices=2503, n_edges=78292, NNtype=radius, ..., order=0) >>> fig = plt.figure() >>> ax1 = fig.add_subplot(121) >>> ax2 = fig.add_subplot(122, projection='3d') diff --git a/pygsp/graphs/nngraphs/cube.py b/pygsp/graphs/nngraphs/cube.py index 820e401c..274a8fe5 100644 --- a/pygsp/graphs/nngraphs/cube.py +++ b/pygsp/graphs/nngraphs/cube.py @@ -26,6 +26,8 @@ class Cube(NNGraph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.Cube(seed=42) + >>> G # doctest: +ELLIPSIS + Cube(n_vertices=300, n_edges=1722, radius=1.00, nb_pts=300, ..., order=0) >>> fig = plt.figure() >>> ax1 = fig.add_subplot(121) >>> ax2 = fig.add_subplot(122, projection='3d') diff --git a/pygsp/graphs/nngraphs/grid2dimgpatches.py b/pygsp/graphs/nngraphs/grid2dimgpatches.py index 34168c00..4c725359 100644 --- a/pygsp/graphs/nngraphs/grid2dimgpatches.py +++ b/pygsp/graphs/nngraphs/grid2dimgpatches.py @@ -28,6 +28,8 @@ class Grid2dImgPatches(Graph): >>> from skimage import data, img_as_float >>> img = img_as_float(data.camera()[::64, ::64]) >>> G = graphs.Grid2dImgPatches(img) + >>> G # doctest: +ELLIPSIS + Grid2dImgPatches(n_vertices=64, n_edges=522, N1=8, N2=8, ..., order=0) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=2) >>> _ = G.plot(ax=axes[1]) diff --git a/pygsp/graphs/nngraphs/imgpatches.py b/pygsp/graphs/nngraphs/imgpatches.py index 73cb6abd..39f9b863 100644 --- a/pygsp/graphs/nngraphs/imgpatches.py +++ b/pygsp/graphs/nngraphs/imgpatches.py @@ -39,6 +39,8 @@ class ImgPatches(NNGraph): >>> from skimage import data, img_as_float >>> img = img_as_float(data.camera()[::64, ::64]) >>> G = graphs.ImgPatches(img, patch_shape=(3, 3)) + >>> G # doctest: +ELLIPSIS + ImgPatches(n_vertices=64, n_edges=473, patch_shape=(3, 3), ..., order=0) >>> print('{} nodes ({} x {} pixels)'.format(G.Xin.shape[0], *img.shape)) 64 nodes (8 x 8 pixels) >>> print('{} features per node'.format(G.Xin.shape[1])) diff --git a/pygsp/graphs/nngraphs/nngraph.py b/pygsp/graphs/nngraphs/nngraph.py index 252a5416..5afea169 100644 --- a/pygsp/graphs/nngraphs/nngraph.py +++ b/pygsp/graphs/nngraphs/nngraph.py @@ -68,6 +68,8 @@ class NNGraph(Graph): >>> import matplotlib.pyplot as plt >>> X = np.random.RandomState(42).uniform(size=(30, 2)) >>> G = graphs.NNGraph(X) + >>> G # doctest: +ELLIPSIS + NNGraph(n_vertices=30, n_edges=187, NNtype=knn, ..., order=0) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=5) >>> _ = G.plot(ax=axes[1]) diff --git a/pygsp/graphs/nngraphs/sensor.py b/pygsp/graphs/nngraphs/sensor.py index ac623a50..d896beb9 100644 --- a/pygsp/graphs/nngraphs/sensor.py +++ b/pygsp/graphs/nngraphs/sensor.py @@ -39,12 +39,16 @@ class Sensor(NNGraph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.Sensor(N=64, seed=42) + >>> G + Sensor(n_vertices=64, n_edges=229, k=6, distributed=False, seed=42) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=2) >>> _ = G.plot(ax=axes[1]) >>> import matplotlib.pyplot as plt >>> G = graphs.Sensor(N=64, distributed=True, seed=42) + >>> G + Sensor(n_vertices=64, n_edges=228, k=6, distributed=True, seed=42) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=2) >>> _ = G.plot(ax=axes[1]) diff --git a/pygsp/graphs/nngraphs/sphere.py b/pygsp/graphs/nngraphs/sphere.py index e375b5b4..8ca231f7 100644 --- a/pygsp/graphs/nngraphs/sphere.py +++ b/pygsp/graphs/nngraphs/sphere.py @@ -26,6 +26,8 @@ class Sphere(NNGraph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.Sphere(nb_pts=100, seed=42) + >>> G # doctest: +ELLIPSIS + Sphere(n_vertices=100, n_edges=581, radius=1.00, nb_pts=100, ..., order=0) >>> fig = plt.figure() >>> ax1 = fig.add_subplot(121) >>> ax2 = fig.add_subplot(122, projection='3d') diff --git a/pygsp/graphs/nngraphs/twomoons.py b/pygsp/graphs/nngraphs/twomoons.py index af87d0d8..cca0da4a 100644 --- a/pygsp/graphs/nngraphs/twomoons.py +++ b/pygsp/graphs/nngraphs/twomoons.py @@ -38,6 +38,8 @@ class TwoMoons(NNGraph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.TwoMoons() + >>> G # doctest: +ELLIPSIS + TwoMoons(n_vertices=2000, n_edges=6132, moontype=standard, ..., order=0) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=0.5) >>> _ = G.plot(edges=True, ax=axes[1]) diff --git a/pygsp/graphs/path.py b/pygsp/graphs/path.py index 94aec2c4..3c036668 100644 --- a/pygsp/graphs/path.py +++ b/pygsp/graphs/path.py @@ -42,6 +42,8 @@ class Path(Graph): ... G = graphs.Path(N=10, directed=directed) ... _ = axes[i, 0].spy(G.W) ... _ = G.plot(ax=axes[i, 1]) + >>> G + Path(n_vertices=10, n_edges=9, directed=True) The GFT of the path graph is the classical DCT. diff --git a/pygsp/graphs/randomregular.py b/pygsp/graphs/randomregular.py index 49c151bd..5647e7f8 100644 --- a/pygsp/graphs/randomregular.py +++ b/pygsp/graphs/randomregular.py @@ -40,6 +40,8 @@ class RandomRegular(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.RandomRegular(N=64, k=5, seed=42) + >>> G + RandomRegular(n_vertices=64, n_edges=160, k=5, seed=42) >>> G.set_coordinates(kind='spring', seed=42) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=2) diff --git a/pygsp/graphs/randomring.py b/pygsp/graphs/randomring.py index 1c24a1d5..cc73d7b0 100644 --- a/pygsp/graphs/randomring.py +++ b/pygsp/graphs/randomring.py @@ -23,6 +23,8 @@ class RandomRing(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.RandomRing(N=10, seed=42) + >>> G + RandomRing(n_vertices=10, n_edges=10, seed=42) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W) >>> _ = G.plot(ax=axes[1]) diff --git a/pygsp/graphs/ring.py b/pygsp/graphs/ring.py index e9da9b4c..c5b34185 100644 --- a/pygsp/graphs/ring.py +++ b/pygsp/graphs/ring.py @@ -36,6 +36,8 @@ class Ring(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.Ring(N=10) + >>> G + Ring(n_vertices=10, n_edges=10, k=1) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W) >>> _ = G.plot(ax=axes[1]) diff --git a/pygsp/graphs/stochasticblockmodel.py b/pygsp/graphs/stochasticblockmodel.py index 63918b72..694182ad 100644 --- a/pygsp/graphs/stochasticblockmodel.py +++ b/pygsp/graphs/stochasticblockmodel.py @@ -52,6 +52,8 @@ class StochasticBlockModel(Graph): >>> import matplotlib.pyplot as plt >>> G = graphs.StochasticBlockModel( ... 100, k=3, p=[0.4, 0.6, 0.3], q=0.02, seed=42) + >>> G # doctest: +ELLIPSIS + StochasticBlockModel(n_vertices=100, n_edges=795, k=3, ..., seed=42) >>> G.set_coordinates(kind='spring', seed=42) >>> fig, axes = plt.subplots(1, 2) >>> _ = axes[0].spy(G.W, markersize=0.8) diff --git a/pygsp/graphs/swissroll.py b/pygsp/graphs/swissroll.py index 7dc4404c..92395a39 100644 --- a/pygsp/graphs/swissroll.py +++ b/pygsp/graphs/swissroll.py @@ -35,6 +35,8 @@ class SwissRoll(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.SwissRoll(N=200, seed=42) + >>> G # doctest: +ELLIPSIS + SwissRoll(n_vertices=200, n_edges=1244, a=1, b=4, dim=3, ..., seed=42) >>> fig = plt.figure() >>> ax1 = fig.add_subplot(121) >>> ax2 = fig.add_subplot(122, projection='3d') diff --git a/pygsp/graphs/torus.py b/pygsp/graphs/torus.py index 1124b7a9..ba76c53f 100644 --- a/pygsp/graphs/torus.py +++ b/pygsp/graphs/torus.py @@ -28,6 +28,8 @@ class Torus(Graph): -------- >>> import matplotlib.pyplot as plt >>> G = graphs.Torus(10) + >>> G + Torus(n_vertices=100, n_edges=200, Nv=10, Mv=10) >>> fig = plt.figure() >>> ax1 = fig.add_subplot(121) >>> ax2 = fig.add_subplot(122, projection='3d')