-
-
Notifications
You must be signed in to change notification settings - Fork 1
36 add save and load methods to serialization manager #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
36 add save and load methods to serialization manager #51
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the SerializationManager class with file-based model serialization capabilities, introducing save and load methods that support multiple formats (JSON, pickle) with automatic file handling. The implementation includes improved error handling by wrapping converter errors in DeserializationError, comprehensive test coverage for various scenarios, and updated version to 0.1.0-alpha.19.
Key changes:
- Added
saveandloadmethods toSerializationManagerfor direct file I/O operations - Enhanced deserialization error handling with try-catch wrapper for converter errors
- Implemented comprehensive test suite covering both success and error scenarios
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| openmodels/core.py | Added save and load methods with file I/O handling, format detection, and enhanced error wrapping in deserialization |
| test/test_core.py | New comprehensive test suite covering JSON/pickle formats, unsupported formats, serializer errors, invalid data, and I/O failures |
| pyproject.toml | Version bumped from 0.1.0-alpha.18 to 0.1.0-alpha.19 |
| testpypi-badge.json | Version badge updated to 0.1.0a19 |
| README.md | Added documentation section demonstrating the new save/load functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces new file-based model serialization and deserialization capabilities to the
SerializationManagerclass, along with robust error handling for file I/O and format support. Additionally, comprehensive tests have been added to validate these new features and edge cases. The version is incremented to reflect these enhancements.Core functionality additions:
saveandloadmethods toSerializationManagerinopenmodels/core.pyfor saving models to and loading models from files in various formats (JSON, pickle), with automatic file extension handling and appropriate file modes.DeserializationErrorfor clearer diagnostics.Testing improvements:
test/test_core.pyto cover saving and loading models in both JSON and pickle formats, handling unsupported formats, serializer errors, invalid data, and file I/O failures.