Spaces:
Sleeping
Sleeping
Test additional branches of code
Browse files- pysr/sklearn_monkeypatch.py +1 -1
- pysr/test/test.py +6 -0
pysr/sklearn_monkeypatch.py
CHANGED
|
@@ -9,5 +9,5 @@ def _ensure_no_complex_data(*args, **kwargs):
|
|
| 9 |
|
| 10 |
try:
|
| 11 |
validation._ensure_no_complex_data = _ensure_no_complex_data
|
| 12 |
-
except AttributeError:
|
| 13 |
...
|
|
|
|
| 9 |
|
| 10 |
try:
|
| 11 |
validation._ensure_no_complex_data = _ensure_no_complex_data
|
| 12 |
+
except AttributeError: # pragma: no cover
|
| 13 |
...
|
pysr/test/test.py
CHANGED
|
@@ -96,6 +96,9 @@ class TestPipeline(unittest.TestCase):
|
|
| 96 |
self.assertLessEqual(best_loss, 1e-10)
|
| 97 |
self.assertGreaterEqual(best_loss, 0.0)
|
| 98 |
|
|
|
|
|
|
|
|
|
|
| 99 |
def test_high_precision_search_custom_loss(self):
|
| 100 |
y = 1.23456789 * self.X[:, 0]
|
| 101 |
model = PySRRegressor(
|
|
@@ -112,6 +115,9 @@ class TestPipeline(unittest.TestCase):
|
|
| 112 |
jl.test_state = model.raw_julia_state_
|
| 113 |
self.assertTrue(jl.seval("typeof(test_state[2]).parameters[1] == Float64"))
|
| 114 |
|
|
|
|
|
|
|
|
|
|
| 115 |
def test_multioutput_custom_operator_quiet_custom_complexity(self):
|
| 116 |
y = self.X[:, [0, 1]] ** 2
|
| 117 |
model = PySRRegressor(
|
|
|
|
| 96 |
self.assertLessEqual(best_loss, 1e-10)
|
| 97 |
self.assertGreaterEqual(best_loss, 0.0)
|
| 98 |
|
| 99 |
+
# Test options stored:
|
| 100 |
+
self.assertEqual(model.julia_options_.turbo, True)
|
| 101 |
+
|
| 102 |
def test_high_precision_search_custom_loss(self):
|
| 103 |
y = 1.23456789 * self.X[:, 0]
|
| 104 |
model = PySRRegressor(
|
|
|
|
| 115 |
jl.test_state = model.raw_julia_state_
|
| 116 |
self.assertTrue(jl.seval("typeof(test_state[2]).parameters[1] == Float64"))
|
| 117 |
|
| 118 |
+
# Test options stored:
|
| 119 |
+
self.assertEqual(model.julia_options_.turbo, False)
|
| 120 |
+
|
| 121 |
def test_multioutput_custom_operator_quiet_custom_complexity(self):
|
| 122 |
y = self.X[:, [0, 1]] ** 2
|
| 123 |
model = PySRRegressor(
|