MilesCranmer commited on
Commit
775c667
1 Parent(s): bad0567

More descriptive name for warm_start test

Browse files
Files changed (1) hide show
  1. test/test.py +3 -2
test/test.py CHANGED
@@ -118,7 +118,7 @@ class TestPipeline(unittest.TestCase):
118
  print("Model equations: ", model.sympy()[1])
119
  print("True equation: x1^2")
120
 
121
- def test_empty_operators_single_input_multirun(self):
122
  X = self.rstate.randn(100, 1)
123
  y = X[:, 0] + 3.0
124
  regressor = PySRRegressor(
@@ -135,7 +135,8 @@ class TestPipeline(unittest.TestCase):
135
  np.testing.assert_almost_equal(regressor.predict(X), y, decimal=1)
136
 
137
  # Test if repeated fit works:
138
- regressor.set_params(niterations=0)
 
139
  regressor.fit(X, y)
140
 
141
  self.assertLessEqual(regressor.equations_.iloc[-1]["loss"], 1e-4)
 
118
  print("Model equations: ", model.sympy()[1])
119
  print("True equation: x1^2")
120
 
121
+ def test_empty_operators_single_input_warm_start(self):
122
  X = self.rstate.randn(100, 1)
123
  y = X[:, 0] + 3.0
124
  regressor = PySRRegressor(
 
135
  np.testing.assert_almost_equal(regressor.predict(X), y, decimal=1)
136
 
137
  # Test if repeated fit works:
138
+ regressor.set_params(niterations=0, warm_start=True)
139
+ # This should exit immediately, and use the old equations
140
  regressor.fit(X, y)
141
 
142
  self.assertLessEqual(regressor.equations_.iloc[-1]["loss"], 1e-4)