Skip to content

Commit b30dea8

Browse files
committed
Unit tests for Surface
1 parent 30a4b62 commit b30dea8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_blocks.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,18 @@ def test_Quiver(self):
309309
block = amp.blocks.Quiver(X, Y, U, V)
310310
return amp.Animation([block])
311311

312+
@animation_compare(baseline_images='Blocks/Surface', nframes=3)
313+
def test_Surface(self):
314+
x = np.linspace(-2*np.pi, 2*np.pi, 100)
315+
t = np.linspace(0, 2*np.pi, 3)
316+
317+
X, Y, T = np.meshgrid(x, x, t)
318+
Z = np.sin(X**2+Y**2-T)
319+
320+
fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
321+
block = amp.blocks.Surface(X[:, :, 0], Y[:, :, 0], Z, t_axis=2)
322+
return amp.Animation([block])
323+
312324
@animation_compare(baseline_images='Blocks/Nuke', nframes=3)
313325
def test_Nuke(self):
314326
ax = plt.gca()

0 commit comments

Comments
 (0)