MilesCranmer commited on
Commit
8da5000
1 Parent(s): 93cf05b

Improve error message for missing operator mappings

Browse files
Files changed (1) hide show
  1. pysr/sr.py +2 -1
pysr/sr.py CHANGED
@@ -1694,7 +1694,8 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
1694
  raise ValueError(
1695
  "Failed to evaluate the expression. "
1696
  "If you are using a custom operator, make sure to define it in :param`extra_sympy_mappings`, "
1697
- "e.g., `model.set_params(extra_sympy_mappings={'inv': lambda x: 1 / x})`."
 
1698
  ) from error
1699
 
1700
  def sympy(self, index=None):
 
1694
  raise ValueError(
1695
  "Failed to evaluate the expression. "
1696
  "If you are using a custom operator, make sure to define it in :param`extra_sympy_mappings`, "
1697
+ "e.g., `model.set_params(extra_sympy_mappings={'inv': lambda x: 1 / x})`. You can then "
1698
+ "run `model.refresh()` to re-load the expressions."
1699
  ) from error
1700
 
1701
  def sympy(self, index=None):