MilesCranmer commited on
Commit
dfabd6e
1 Parent(s): e995bc1

Prevent users from using a tiny maxsize, as behaviour is undefined

Browse files
Files changed (1) hide show
  1. pysr/sr.py +2 -0
pysr/sr.py CHANGED
@@ -309,6 +309,8 @@ def pysr(
309
  warnings.warn(
310
  "Note: Using a large maxsize for the equation search will be exponentially slower and use significant memory. You should consider turning `useFrequency` to False, and perhaps use `warmupMaxsizeBy`."
311
  )
 
 
312
 
313
  X, variable_names, selection = _handle_feature_selection(
314
  X, select_k_features, use_custom_variable_names, variable_names, y
 
309
  warnings.warn(
310
  "Note: Using a large maxsize for the equation search will be exponentially slower and use significant memory. You should consider turning `useFrequency` to False, and perhaps use `warmupMaxsizeBy`."
311
  )
312
+ if maxsize < 7:
313
+ raise NotImplementedError("PySR requires a maxsize of at least 7")
314
 
315
  X, variable_names, selection = _handle_feature_selection(
316
  X, select_k_features, use_custom_variable_names, variable_names, y