Skip to content

Custom __reduce__ methods to allow pickling solvers#38

Merged
c-randall merged 2 commits into
mainfrom
feature/serialize
Dec 2, 2025
Merged

Custom __reduce__ methods to allow pickling solvers#38
c-randall merged 2 commits into
mainfrom
feature/serialize

Conversation

@c-randall

Copy link
Copy Markdown
Collaborator

Description

Due to the C extensions, the default pickling routines pickle.dump and pickle.load did not work with the solvers. Support functions and custom __reduce__ methods were added to resolve this, allowing both CVODE and IDA to be serialized and deserialized using pickle.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that improves speed/readability/etc.)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist

  • No style issues: $ nox -s linter [-- format]
  • Code is free of misspellings: $ nox -s codespell [-- write]
  • All tests pass: $ nox -s tests
  • Badges are updated: $ nox -s badges

Further checks:

  • The documentation builds: $ nox -s docs.
  • Code is commented, particularly in hard-to-understand areas.
  • Tests are added that prove fix is effective or that feature works.

@c-randall c-randall marked this pull request as ready for review December 2, 2025 16:33
@c-randall c-randall merged commit 960c352 into main Dec 2, 2025
9 checks passed
@c-randall c-randall deleted the feature/serialize branch December 2, 2025 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant