Spaces:
Sleeping
Sleeping
Commit
·
5ada6c7
1
Parent(s):
3da0df5
Make default niterations into globals in test
Browse files- test/test.py +8 -8
test/test.py
CHANGED
|
@@ -9,22 +9,22 @@ import sympy
|
|
| 9 |
import pandas as pd
|
| 10 |
import warnings
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
class TestPipeline(unittest.TestCase):
|
| 14 |
def setUp(self):
|
| 15 |
# Using inspect,
|
| 16 |
# get default niterations from PySRRegressor, and double them:
|
| 17 |
-
default_niterations = (
|
| 18 |
-
inspect.signature(PySRRegressor.__init__).parameters["niterations"].default
|
| 19 |
-
)
|
| 20 |
-
default_populations = (
|
| 21 |
-
inspect.signature(PySRRegressor.__init__).parameters["populations"].default
|
| 22 |
-
)
|
| 23 |
self.default_test_kwargs = dict(
|
| 24 |
progress=False,
|
| 25 |
model_selection="accuracy",
|
| 26 |
-
niterations=
|
| 27 |
-
populations=
|
| 28 |
temp_equation_file=True,
|
| 29 |
)
|
| 30 |
self.rstate = np.random.RandomState(0)
|
|
|
|
| 9 |
import pandas as pd
|
| 10 |
import warnings
|
| 11 |
|
| 12 |
+
DEFAULT_NITERATIONS = (
|
| 13 |
+
inspect.signature(PySRRegressor.__init__).parameters["niterations"].default
|
| 14 |
+
)
|
| 15 |
+
DEFAULT_POPULATIONS = (
|
| 16 |
+
inspect.signature(PySRRegressor.__init__).parameters["populations"].default
|
| 17 |
+
)
|
| 18 |
|
| 19 |
class TestPipeline(unittest.TestCase):
|
| 20 |
def setUp(self):
|
| 21 |
# Using inspect,
|
| 22 |
# get default niterations from PySRRegressor, and double them:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
self.default_test_kwargs = dict(
|
| 24 |
progress=False,
|
| 25 |
model_selection="accuracy",
|
| 26 |
+
niterations=DEFAULT_NITERATIONS * 2,
|
| 27 |
+
populations=DEFAULT_POPULATIONS * 2,
|
| 28 |
temp_equation_file=True,
|
| 29 |
)
|
| 30 |
self.rstate = np.random.RandomState(0)
|