Skip to content

Commit e489d33

Browse files
committed
Add missing test.
1 parent a44114a commit e489d33

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/nevaluate.cdb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
# ex:=A + B \cos(x);
3+
# nevaluate(ex, {$A$: 1, $B$: 3, $x$: np.linspace(0, 10, 10)});
4+
5+
import time
6+
import matplotlib.pyplot as plt
7+
import numpy as np
8+
9+
def test01():
10+
start = time.time()
11+
ex:= \cos(x) \sin(y);
12+
xv = np.linspace(0, 3.14, 100);
13+
yv = np.linspace(0, 3.14, 100);
14+
z = np.array( nevaluate(ex, {$x$: xv, $y$: yv} ) )
15+
end = time.time()
16+
print("that took", end-start, "seconds")
17+
print("Test 01 passed")
18+
# XV, YV=np.meshgrid(xv, yv)
19+
# plt.figure(figsize=(20, 10))
20+
# ax = plt.axes(projection='3d')
21+
# ax.plot_surface(XV, YV, z, rstride=1, cstride=1, cmap='terrain', edgecolor=None)
22+
23+
test01()
24+
25+

0 commit comments

Comments
 (0)