MilesCranmer commited on
Commit
6b61b25
1 Parent(s): 74da094

Fix missing pickle warning

Browse files
Files changed (1) hide show
  1. pysr/sr.py +3 -0
pysr/sr.py CHANGED
@@ -1054,6 +1054,9 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
1054
  from the pickled instance.
1055
  """
1056
  state = self.__dict__
 
 
 
1057
  state_keys_containing_lambdas = ["extra_sympy_mappings", "extra_torch_mappings"]
1058
  for state_key in state_keys_containing_lambdas:
1059
  if state[state_key] is not None and show_pickle_warning:
 
1054
  from the pickled instance.
1055
  """
1056
  state = self.__dict__
1057
+ show_pickle_warning = not (
1058
+ "show_pickle_warnings_" in state and not state["show_pickle_warnings_"]
1059
+ )
1060
  state_keys_containing_lambdas = ["extra_sympy_mappings", "extra_torch_mappings"]
1061
  for state_key in state_keys_containing_lambdas:
1062
  if state[state_key] is not None and show_pickle_warning: