Skip to content

Conversation

@Gnpd
Copy link
Owner

@Gnpd Gnpd commented Nov 11, 2025

This pull request introduces new file-based model serialization and deserialization capabilities to the SerializationManager class, 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:

  • Added save and load methods to SerializationManager in openmodels/core.py for saving models to and loading models from files in various formats (JSON, pickle), with automatic file extension handling and appropriate file modes.
  • Improved error handling in deserialization by wrapping converter errors in a DeserializationError for clearer diagnostics.

Testing improvements:

  • Introduced a new test suite in test/test_core.py to cover saving and loading models in both JSON and pickle formats, handling unsupported formats, serializer errors, invalid data, and file I/O failures.

Copy link
Contributor

Copilot AI left a 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 save and load methods to SerializationManager for 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.

@Gnpd Gnpd merged commit 134d25e into main Nov 14, 2025
6 checks passed
@Gnpd Gnpd deleted the 36-Add-save-and-load-Methods-to-SerializationManager branch November 14, 2025 05:48
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.

Proposal: Add save and load Methods to SerializationManager

2 participants