Skip to content

Commit 9446d55

Browse files
committed
small code cleanups
1 parent 9903f83 commit 9446d55

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

WrightTools/artists/_animate.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ def animate_quick(q2d: Quick1DIterator | Quick2DIterator, **kwargs) -> FuncAnima
146146
**kwargs: dict items
147147
all extra kwargs are passed to matplotlib.FuncAnimation
148148
149+
150+
Example
151+
-------
152+
```python
153+
quick_iter = wt.artists.quick1Ds(data, autosave=False, local=False)
154+
ani = wt.artists.animate_quick(quick_iter, interval=100)
155+
```
156+
149157
"""
150158

151159
return FuncAnimation(fig=q2d.fig, func=lambda x: None, frames=q2d, **kwargs)
@@ -168,6 +176,13 @@ def animate_interact2D(
168176
169177
**kwargs: dict items
170178
all extra kwargs are passed to matplotlib.FuncAnimation
179+
180+
Example
181+
-------
182+
```python
183+
interactive = wt.artists.interact2D(data, local=True)
184+
ani = wt.artists.animate_interact2D(interactive, back_and_forth=True, interval=500)
185+
```
171186
"""
172187

173188
def update(frame):

tests/artists/test_animate.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ def test_animate_quick2D():
4141

4242
def test_animate_quick1D():
4343
d = wt.open(datasets.wt5.v1p0p1_MoS2_TrEE_movie).at(d2=[0, "fs"])
44-
quick1D = wt.artists.quick1Ds(d, autosave=False, local=False)
44+
quick_iter = wt.artists.quick1Ds(d, autosave=False, local=False)
4545

46-
ani = wt.artists.animate_quick(quick1D, interval=100)
46+
ani = wt.artists.animate_quick(quick_iter, interval=100)
4747
return ani
4848

4949

5050
if __name__ == "__main__":
51-
ani1 = test_animate2D()
52-
ani2 = test_animate_interact2D()
53-
ani3 = test_animate_quick2D()
54-
ani4 = test_animate_quick1D()
51+
_unused_ani1 = test_animate2D()
52+
_unused_ani2 = test_animate_interact2D()
53+
_unused_ani3 = test_animate_quick2D()
54+
_unused_ani4 = test_animate_quick1D()
5555
plt.show()

0 commit comments

Comments
 (0)