MilesCranmer commited on
Commit
038eaaf
1 Parent(s): 009d206

Add test for DaemonMode

Browse files
Files changed (1) hide show
  1. test/test.py +15 -12
test/test.py CHANGED
@@ -69,18 +69,21 @@ class TestPipeline(unittest.TestCase):
69
  best_callable()[1](self.X), self.X[:, 1] ** 2, decimal=4
70
  )
71
 
72
- def test_empty_operators_single_input(self):
73
- X = np.random.randn(100, 1)
74
- y = X[:, 0] + 3.0
75
- equations = pysr(
76
- X,
77
- y,
78
- unary_operators=[],
79
- binary_operators=["plus"],
80
- **self.default_test_kwargs,
81
- )
82
-
83
- self.assertLessEqual(equations.iloc[-1]["MSE"], 1e-4)
 
 
 
84
 
85
  def test_noisy(self):
86
 
 
69
  best_callable()[1](self.X), self.X[:, 1] ** 2, decimal=4
70
  )
71
 
72
+ def test_empty_operators_single_input_daemon(self):
73
+ for i in range(2):
74
+ np.random.seed(i)
75
+ X = np.random.randn(100, 1)
76
+ y = X[:, 0] + 3.0
77
+ equations = pysr(
78
+ X,
79
+ y,
80
+ unary_operators=[],
81
+ binary_operators=["plus"],
82
+ **self.default_test_kwargs,
83
+ daemon_mode=True,
84
+ )
85
+
86
+ self.assertLessEqual(equations.iloc[-1]["MSE"], 1e-4)
87
 
88
  def test_noisy(self):
89