MilesCranmer commited on
Commit
7f2ee62
1 Parent(s): afef357

Syntax error in kwargs

Browse files
Files changed (1) hide show
  1. pysr/sr.py +7 -6
pysr/sr.py CHANGED
@@ -229,7 +229,8 @@ def pysr(X=None, y=None, weights=None,
229
  """
230
  assert warmupMaxsize == None, "warmupMaxsize is deprecated. Use warmupMaxsizeBy and give a fraction of time."
231
  if nrestarts != None:
232
- optimizer_nrestarts=nrestarts
 
233
  assert optimizer_algorithm in ['NelderMead', 'BFGS']
234
 
235
  if isinstance(X, pd.DataFrame):
@@ -276,10 +277,10 @@ def pysr(X=None, y=None, weights=None,
276
  fractionReplacedHof=fractionReplacedHof,
277
  hofMigration=hofMigration, maxdepth=maxdepth,
278
  maxsize=maxsize, migration=migration,
279
- optimizer_algorithm=optimizer_algorithm
280
- optimizer_nrestarts=optimizer_nrestarts
281
- optimize_probability=optimize_probability
282
- optimizer_iterations=optimizer_iterations
283
  parsimony=parsimony, perturbationFactor=perturbationFactor,
284
  populations=populations, procs=procs,
285
  shouldOptimizeConstants=shouldOptimizeConstants,
@@ -487,7 +488,7 @@ fractionReplacedHof={fractionReplacedHof}f0,
487
  shouldOptimizeConstants={'true' if shouldOptimizeConstants else 'false'},
488
  hofFile="{_escape_filename(equation_file)}",
489
  npopulations={populations:d},
490
- optimizer_algorithm={optimizer_algorithm},
491
  optimizer_nrestarts={optimizer_nrestarts:d},
492
  optimize_probability={optimize_probability:f}f0,
493
  optimizer_iterations={optimizer_iterations:d},
 
229
  """
230
  assert warmupMaxsize == None, "warmupMaxsize is deprecated. Use warmupMaxsizeBy and give a fraction of time."
231
  if nrestarts != None:
232
+ optimizer_nrestarts = nrestarts
233
+
234
  assert optimizer_algorithm in ['NelderMead', 'BFGS']
235
 
236
  if isinstance(X, pd.DataFrame):
 
277
  fractionReplacedHof=fractionReplacedHof,
278
  hofMigration=hofMigration, maxdepth=maxdepth,
279
  maxsize=maxsize, migration=migration,
280
+ optimizer_algorithm=optimizer_algorithm,
281
+ optimizer_nrestarts=optimizer_nrestarts,
282
+ optimize_probability=optimize_probability,
283
+ optimizer_iterations=optimizer_iterations,
284
  parsimony=parsimony, perturbationFactor=perturbationFactor,
285
  populations=populations, procs=procs,
286
  shouldOptimizeConstants=shouldOptimizeConstants,
 
488
  shouldOptimizeConstants={'true' if shouldOptimizeConstants else 'false'},
489
  hofFile="{_escape_filename(equation_file)}",
490
  npopulations={populations:d},
491
+ optimizer_algorithm="{optimizer_algorithm}",
492
  optimizer_nrestarts={optimizer_nrestarts:d},
493
  optimize_probability={optimize_probability:f}f0,
494
  optimizer_iterations={optimizer_iterations:d},