Implement persistent parameter file management #443
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces the
ParamFileManager
class, which is responsible for reading and writing parameter configurations from a file. This functionality is helpful for persisting parameter states across different sessions, allowing users to save, load and share parameter configurations as needed.Key changes include:
New
ParamFileManager
class: This class provides static methods for reading and writing parameter configurations to a file. It uses the YAML format for file storage, providing human-readable files and supporting complex data structures.Support for
PersistentParamState
objects: Thewrite
method ofParamFileManager
supportsPersistentParamState
objects. It extracts theis_stored
,default_value
, andstored_value
attributes of these objects and writes them to the file.Robust file reading: The
read
method ofParamFileManager
includes checks for file type and version, raising exceptions if these fields are missing or unsupported. It also includes error handling for YAML parsing errors.This implementation provides a solid foundation for parameter file management. Future work may include extending support to other parameter types, improving error handling, and integrating this functionality into the broader system.