MilesCranmer commited on
Commit
178a8f8
1 Parent(s): 144e3ff

test: update tests to non-simplifying sympy

Browse files
Files changed (1) hide show
  1. pysr/test/test.py +3 -3
pysr/test/test.py CHANGED
@@ -674,7 +674,7 @@ class TestMiscellaneous(unittest.TestCase):
674
  pd.testing.assert_frame_equal(frame1[cols_to_check], frame2[cols_to_check])
675
 
676
  y_predictions2 = model2.predict(X)
677
- np.testing.assert_array_equal(y_predictions, y_predictions2)
678
 
679
  def test_scikit_learn_compatibility(self):
680
  """Test PySRRegressor compatibility with scikit-learn."""
@@ -1039,7 +1039,7 @@ class TestLaTeXTable(unittest.TestCase):
1039
  middle_part_2 = r"""
1040
  $y_{1} = x_{1}$ & $1$ & $1.32$ & $0.0$ \\
1041
  $y_{1} = \cos{\left(x_{1} \right)}$ & $2$ & $0.0520$ & $3.23$ \\
1042
- $y_{1} = x_{0}^{2} x_{1}$ & $5$ & $2.00 \cdot 10^{-15}$ & $10.3$ \\
1043
  """
1044
  true_latex_table_str = "\n\n".join(
1045
  self.create_true_latex(part, include_score=True)
@@ -1092,7 +1092,7 @@ class TestLaTeXTable(unittest.TestCase):
1092
  middle_part = r"""
1093
  $y = x_{0}$ & $1$ & $1.05$ & $0.0$ \\
1094
  $y = \cos{\left(x_{0} \right)}$ & $2$ & $0.0232$ & $3.82$ \\
1095
- \begin{minipage}{0.8\linewidth} \vspace{-1em} \begin{dmath*} y = x_{0}^{5} + x_{0}^{3} + 3.20 x_{0} + x_{1}^{3} - 1.20 x_{1} - 5.20 \sin{\left(2.60 x_{0} - 0.326 \sin{\left(x_{2} \right)} \right)} - \cos{\left(x_{0} x_{1} \right)} + \cos{\left(x_{0}^{3} + 3.20 x_{0} + x_{1}^{3} - 1.20 x_{1} + \cos{\left(x_{0} x_{1} \right)} \right)} \end{dmath*} \end{minipage} & $30$ & $1.12 \cdot 10^{-15}$ & $1.09$ \\
1096
  """
1097
  true_latex_table_str = (
1098
  TRUE_PREAMBLE
 
674
  pd.testing.assert_frame_equal(frame1[cols_to_check], frame2[cols_to_check])
675
 
676
  y_predictions2 = model2.predict(X)
677
+ np.testing.assert_array_almost_equal(y_predictions, y_predictions2)
678
 
679
  def test_scikit_learn_compatibility(self):
680
  """Test PySRRegressor compatibility with scikit-learn."""
 
1039
  middle_part_2 = r"""
1040
  $y_{1} = x_{1}$ & $1$ & $1.32$ & $0.0$ \\
1041
  $y_{1} = \cos{\left(x_{1} \right)}$ & $2$ & $0.0520$ & $3.23$ \\
1042
+ $y_{1} = x_{0} x_{0} x_{1}$ & $5$ & $2.00 \cdot 10^{-15}$ & $10.3$ \\
1043
  """
1044
  true_latex_table_str = "\n\n".join(
1045
  self.create_true_latex(part, include_score=True)
 
1092
  middle_part = r"""
1093
  $y = x_{0}$ & $1$ & $1.05$ & $0.0$ \\
1094
  $y = \cos{\left(x_{0} \right)}$ & $2$ & $0.0232$ & $3.82$ \\
1095
+ \begin{minipage}{0.8\linewidth} \vspace{-1em} \begin{dmath*} y = x_{0} x_{0} x_{0} + x_{0} x_{0} x_{0} x_{0} x_{0} + 3.20 x_{0} - 1.20 x_{1} + x_{1} x_{1} x_{1} + 5.20 \sin{\left(- 2.60 x_{0} + 0.326 \sin{\left(x_{2} \right)} \right)} - \cos{\left(x_{0} x_{1} \right)} + \cos{\left(x_{0} x_{0} x_{0} + 3.20 x_{0} - 1.20 x_{1} + x_{1} x_{1} x_{1} + \cos{\left(x_{0} x_{1} \right)} \right)} \end{dmath*} \end{minipage} & $30$ & $1.12 \cdot 10^{-15}$ & $1.09$ \\
1096
  """
1097
  true_latex_table_str = (
1098
  TRUE_PREAMBLE