Spaces:
Running
Running
deepsource-autofix[bot]
commited on
Format code with black
Browse filesThis commit fixes the style issues introduced in 1443fba according to the output
from black.
Details: https://deepsource.io/gh/MilesCranmer/PySR/transform/99c6e3c5-2014-4378-8de4-c4453d52e164/
- benchmarks/space.py +3 -1
- pysr/deprecated.py +2 -1
- test/test.py +2 -1
benchmarks/space.py
CHANGED
|
@@ -62,7 +62,9 @@ space = dict(
|
|
| 62 |
"crossover_probability", np.log(0.00001), np.log(0.2)
|
| 63 |
),
|
| 64 |
# perturbation_factor=1.0,
|
| 65 |
-
perturbation_factor=hp.loguniform(
|
|
|
|
|
|
|
| 66 |
# maxsize=20,
|
| 67 |
maxsize=hp.choice("maxsize", [30]),
|
| 68 |
# warmup_maxsize_by=0.0,
|
|
|
|
| 62 |
"crossover_probability", np.log(0.00001), np.log(0.2)
|
| 63 |
),
|
| 64 |
# perturbation_factor=1.0,
|
| 65 |
+
perturbation_factor=hp.loguniform(
|
| 66 |
+
"perturbation_factor", np.log(0.0001), np.log(100)
|
| 67 |
+
),
|
| 68 |
# maxsize=20,
|
| 69 |
maxsize=hp.choice("maxsize", [30]),
|
| 70 |
# warmup_maxsize_by=0.0,
|
pysr/deprecated.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
"""Various functions to deprecate features."""
|
| 2 |
|
|
|
|
| 3 |
def make_deprecated_kwargs_for_pysr_regressor():
|
| 4 |
"""Create dict of deprecated kwargs."""
|
| 5 |
|
|
@@ -33,4 +34,4 @@ def make_deprecated_kwargs_for_pysr_regressor():
|
|
| 33 |
old, new = line.split("=>")
|
| 34 |
deprecated_kwargs[old] = new
|
| 35 |
|
| 36 |
-
return deprecated_kwargs
|
|
|
|
| 1 |
"""Various functions to deprecate features."""
|
| 2 |
|
| 3 |
+
|
| 4 |
def make_deprecated_kwargs_for_pysr_regressor():
|
| 5 |
"""Create dict of deprecated kwargs."""
|
| 6 |
|
|
|
|
| 34 |
old, new = line.split("=>")
|
| 35 |
deprecated_kwargs[old] = new
|
| 36 |
|
| 37 |
+
return deprecated_kwargs
|
test/test.py
CHANGED
|
@@ -268,6 +268,7 @@ class TestFeatureSelection(unittest.TestCase):
|
|
| 268 |
|
| 269 |
class TestMiscellaneous(unittest.TestCase):
|
| 270 |
"""Test miscellaneous functions."""
|
|
|
|
| 271 |
def test_deprecation(self):
|
| 272 |
# Ensure that deprecation works as expected, with a warning,
|
| 273 |
# and sets the correct value.
|
|
@@ -276,4 +277,4 @@ class TestMiscellaneous(unittest.TestCase):
|
|
| 276 |
# This is a deprecated parameter, so we should get a warning.
|
| 277 |
|
| 278 |
# The correct value should be set:
|
| 279 |
-
self.assertEqual(model.params["fraction_replaced"], 0.2)
|
|
|
|
| 268 |
|
| 269 |
class TestMiscellaneous(unittest.TestCase):
|
| 270 |
"""Test miscellaneous functions."""
|
| 271 |
+
|
| 272 |
def test_deprecation(self):
|
| 273 |
# Ensure that deprecation works as expected, with a warning,
|
| 274 |
# and sets the correct value.
|
|
|
|
| 277 |
# This is a deprecated parameter, so we should get a warning.
|
| 278 |
|
| 279 |
# The correct value should be set:
|
| 280 |
+
self.assertEqual(model.params["fraction_replaced"], 0.2)
|