Skip to content

Commit 045ba27

Browse files
authored
Merge pull request #23 from ksunden/doc_fill
Fill out example descriptions, including crossreferences
2 parents d18a891 + aee0d45 commit 045ba27

File tree

12 files changed

+42
-28
lines changed

12 files changed

+42
-28
lines changed

docs/source/api/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ Wrappers
1818

1919
.. automodule:: data_prototype.wrappers
2020
:members:
21+
:undoc-members:
22+
23+
.. automodule:: data_prototype.patches
24+
:members:
25+
:undoc-members:

examples/2Dfunc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
A functional 2D image
44
=====================
55
6-
6+
A 2D image generated using :class:`.containers.FuncContainer` and
7+
:class:`wrappers.ImageWrapper`.
78
"""
89

910
import matplotlib.pyplot as plt

examples/animation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
An animated line
44
================
55
6+
An animated line using a custom container class,
7+
:class:`.wrappers.LineWrapper`, and :class:`.wrappers.FormatedText`.
68
79
"""
810
import time

examples/data_frame.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""
2-
=================
2+
===============
33
Show data frame
4-
=================
4+
===============
55
6-
The hello-world
6+
Wrapping a :class:`pandas.DataFrame` using :class:`.containers.DataFrameContainer`
7+
and :class:`.wrappers.LineWrapper`.
78
"""
89

910
import matplotlib.pyplot as plt

examples/errorbar.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""
2-
=================
3-
Show data frame
4-
=================
2+
==============
3+
Errorbar graph
4+
==============
55
6-
The hello-world
6+
Using :class:`.containers.ArrayContainer` and :class:`.wrappers.ErrorbarWrapper`
7+
to plot a graph with error bars.
78
"""
89

910
import matplotlib.pyplot as plt

examples/first.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
A functional line
44
=================
55
6-
The hello-world
6+
Demonstrating the differences between :class:`.containers.FuncContainer` and
7+
:class:`.containers.SeriesContainer` using :class:`.wrappers.LineWrapper`.
78
"""
89

910
import matplotlib.pyplot as plt

examples/hist.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
A re-binning histogram
44
======================
55
6-
6+
A :class:`.containers.HistContainer` which is used with :class:`.wrappers.StepWrapper`
7+
to provide a histogram which recomputes the bins based on a range selected.
78
"""
89

910
import matplotlib.pyplot as plt

examples/lissajous.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
Inspired by https://twitter.com/_brohrer_/status/1584681864648065027
77
8+
An animated scatter plot using a custom container and :class:`.wrappers.PathCollectionWrapper`
89
910
"""
1011
import time
@@ -19,7 +20,7 @@
1920

2021
from data_prototype.containers import _MatplotlibTransform, Desc
2122

22-
from data_prototype.wrappers import PathCollectionWrapper, FormatedText
23+
from data_prototype.wrappers import PathCollectionWrapper
2324

2425

2526
class Lissajous:
@@ -31,7 +32,6 @@ def describe(self):
3132
return {
3233
"x": Desc([self.N], float),
3334
"y": Desc([self.N], float),
34-
"phase": Desc([], float),
3535
"time": Desc([], float),
3636
"sizes": Desc([], float),
3737
"paths": Desc([], float),
@@ -53,7 +53,6 @@ def next_time():
5353
return {
5454
"x": np.cos(5 * phase),
5555
"y": np.sin(3 * phase),
56-
"phase": phase[0],
5756
"sizes": np.array([256]),
5857
"paths": [marker_obj.get_path().transformed(marker_obj.get_transform())],
5958
"edgecolors": "k",
@@ -70,27 +69,19 @@ def update(frame, art):
7069

7170
sot_c = Lissajous()
7271

73-
fc = FormatedText(
74-
sot_c,
75-
{"text": lambda phase: f"ϕ={phase:.2f} "},
76-
x=1,
77-
y=1,
78-
ha="right",
79-
)
8072
fig, ax = plt.subplots()
8173
ax.set_xlim(-1.1, 1.1)
8274
ax.set_ylim(-1.1, 1.1)
8375
lw = PathCollectionWrapper(sot_c, offset_transform=ax.transData)
8476
ax.add_artist(lw)
85-
ax.add_artist(fc)
8677
# ax.set_xticks([])
8778
# ax.set_yticks([])
8879
ax.set_aspect(1)
8980
ani = FuncAnimation(
9081
fig,
91-
partial(update, art=(lw, fc)),
92-
frames=60 * 15,
93-
interval=1000 / 100,
82+
partial(update, art=(lw,)),
83+
frames=60,
84+
interval=1000 / 100 * 15,
9485
# TODO: blitting does not work because wrappers do not inherent from Artist
9586
# blit=True,
9687
)

examples/mandelbrot.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
(Infinitly) Zoomable Mandelbrot Set
44
===================================
55
6+
A mandelbrot set which is computed using a :class:`.containers.FuncContainer`
7+
and represented using a :class:`wrappers.ImageWrapper`.
8+
9+
The mandelbrot recomputes as it is zoomed in and/or panned.
610
711
"""
812

examples/mulivariate_cmap.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
"""
2-
=====================
3-
A functional 2D image
4-
=====================
2+
=========================
3+
Custom bivariate colormap
4+
=========================
55
66
7+
Using ``nu`` functions to account for two values when computing the color
8+
of each pixel.
79
"""
810

911
import matplotlib.pyplot as plt

examples/simple_patch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Simple patch artists
44
====================
55
6+
Draw two fully specified rectangle patches.
7+
Demonstrates :class:`.patches.RectangleWrapper` using
8+
:class:`.containers.ArrayContainer`.
9+
610
"""
711
import numpy as np
812

examples/simple_scatter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
An simple scatter plot using PathCollectionWrapper
44
==================================================
55
6-
A quick example using ``containers.ArrayContainer`` and ``wrappers.PathCollectionWrapper``.
6+
A quick scatter plot using :class:`.containers.ArrayContainer` and
7+
:class:`.wrappers.PathCollectionWrapper`.
78
"""
89
import numpy as np
910

0 commit comments

Comments
 (0)