Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
00a6f27
1
Parent(s):
d7444a2
Test manual passing of equations
Browse files- test/test.py +4 -2
test/test.py
CHANGED
@@ -60,13 +60,15 @@ class TestBest(unittest.TestCase):
|
|
60 |
multioutput=False, nout=1)
|
61 |
|
62 |
def test_best(self):
|
|
|
63 |
self.assertEqual(best(), sympy.cos(sympy.Symbol('x0'))**2)
|
64 |
|
65 |
def test_best_tex(self):
|
|
|
66 |
self.assertEqual(best_tex(), '\\cos^{2}{\\left(x_{0} \\right)}')
|
67 |
|
68 |
def test_best_lambda(self):
|
69 |
-
f = best_callable()
|
70 |
X = np.random.randn(10, 2)
|
71 |
y = np.cos(X[:, 0])**2
|
72 |
-
|
|
|
|
60 |
multioutput=False, nout=1)
|
61 |
|
62 |
def test_best(self):
|
63 |
+
self.assertEqual(best(self.equations), sympy.cos(sympy.Symbol('x0'))**2)
|
64 |
self.assertEqual(best(), sympy.cos(sympy.Symbol('x0'))**2)
|
65 |
|
66 |
def test_best_tex(self):
|
67 |
+
self.assertEqual(best_tex(self.equations), '\\cos^{2}{\\left(x_{0} \\right)}')
|
68 |
self.assertEqual(best_tex(), '\\cos^{2}{\\left(x_{0} \\right)}')
|
69 |
|
70 |
def test_best_lambda(self):
|
|
|
71 |
X = np.random.randn(10, 2)
|
72 |
y = np.cos(X[:, 0])**2
|
73 |
+
for f in [best_callable(), best_callable(self.equations))]:
|
74 |
+
np.testing.assert_almost_equal(f(X), y)
|