Skip to content

Commit

Permalink
fix: clear logger_ from saved state to fix #779
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Dec 13, 2024
1 parent 376f4df commit fa2b4a5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pysr/sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,7 @@ def __getstate__(self) -> dict[str, Any]:
f"`{state_key}` at runtime."
)
state_keys_to_clear = state_keys_containing_lambdas
state_keys_to_clear.append("logger_")
pickled_state = {
key: (None if key in state_keys_to_clear else value)
for key, value in state.items()
Expand Down

0 comments on commit fa2b4a5

Please sign in to comment.