@@ -82,7 +82,7 @@ def file_data(url):
8282 y = np .array (y , dtype = np .float64 )
8383
8484 return label , x , y
85- """
85+
8686def test_d_bacres1 ():
8787 label , x , y = file_data ("https://raw.githubusercontent.com/lacava/ode-strogatz/master/d_bacres1.txt" )
8888
@@ -102,8 +102,6 @@ def test_d_bacres1():
102102 binary_operators = {"*" : (operator .mul , operator .mul ),
103103 "+" : (operator .add , operator .add ),
104104 "/" : (operator .truediv , operator .truediv )},
105- #extra_start_sym_expr = [sympy.sympify("_1235/(_1228*x**2 + _1230*x + _1233) + _1239*x/(_1236*x**2 + _1237*x + _1238) + _1244*y/(_1240*x**2 + _1241*x + _1242) + _1248*x*y/(_1245*x**2 + _1246*x + _1247) + _1251")],
106- discrete_param_values = ["(-2, 2)", 20],
107105 operator_depth = {"/" : 1 , "*" : 2 , "+" : 2 },
108106 #callback = callback,
109107 #monothread = True,
@@ -113,9 +111,8 @@ def test_d_bacres1():
113111 model .fit ([x , y ], label , ["x" , "y" ])
114112
115113 assert (len (model .bestExpressions ) == 1 )
116- assert(sympy.expand(model.bestExpressions[0][0]) == sympy.expand(sympy.simplify(sympy.sympify("20 -x - (2*x*y/(2+1*x**2))"))))
117- """
118- """
114+ assert (sr .expr_eq (sympy .expand (model .bestExpressions [0 ][0 ]), sympy .expand (sympy .simplify (sympy .sympify ("20 -x - (*x*y/(1+0.5*x**2))" )))))
115+
119116def test_d_bacres2 ():
120117 label , x , y = file_data ("https://raw.githubusercontent.com/lacava/ode-strogatz/master/d_bacres2.txt" )
121118
@@ -135,7 +132,6 @@ def test_d_bacres2():
135132 binary_operators = {"*" : (operator .mul , operator .mul ),
136133 "+" : (operator .add , operator .add ),
137134 "/" : (operator .truediv , operator .truediv )},
138- discrete_param_values = ["(-2, 2)", 10],
139135 operator_depth = {"/" : 1 , "*" : 2 , "+" : 2 },
140136 #callback = callback,
141137 #monothread = True,
@@ -146,7 +142,7 @@ def test_d_bacres2():
146142
147143 assert (len (model .bestExpressions ) == 1 )
148144 assert (sr .expr_eq (sympy .expand (model .bestExpressions [0 ][0 ]), sympy .expand (sympy .simplify (sympy .sympify ("10 - (x*y/(1+0.5*x**2))" )))))
149- """
145+
150146def test_d_barmag1 ():
151147 label , x , y = file_data ("https://raw.githubusercontent.com/lacava/ode-strogatz/master/d_barmag1.txt" )
152148
0 commit comments