MilesCranmer commited on
Commit
95c956e
2 Parent(s): 1443fba 042b27f

Merge pull request #131 from MilesCranmer/deepsource-transform-9e2a0e1f

Browse files
Files changed (3) hide show
  1. benchmarks/space.py +3 -1
  2. pysr/deprecated.py +2 -1
  3. 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("perturbation_factor", np.log(0.0001), np.log(100)),
 
 
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)