-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix/deep copy issue 153 based on issue 168 (#207)
* Implement unit tests catching issue #168. * Refactor state point management in Job class. And explicitly check key type in SyncedDict. * Remove obsolete SPDict class from job module. * Test the implicit tuple to list conversion. * Refactor the `Job.reset_statepoint()` function for clarity. * Use property instead of internal variable. * Refactor 'reset_document' function into JSONDict class. The reset function for the Job.document and Project.document is thereby implemented as part of the JSONDict class. * Convert mappings upon reset (JSONDict). * Refactor Job constructor. * Implement unit tests that catch issue with deep-copying a state point. Modifying a deep copy of a job state point should not change the job's actual state point. * Committing a fix for now, awaiting for further evaluation of expected behavior * Update state point copy/deepcopy behavior to be essentially opposite. * copy: Copy the statepoint, but keep reference to original job, the original job is modified as we modify the state point. * deepcopy: Create a deep copy of the statepoint, with a new job instance, the original job instance is left intact as we modify the copied state point. This means the original job is no longer in the project upon state point modification. * Update test_interface_(deep)copy unit tests. * Implement copy/deepcopy for instances of Job. And add related unit tests. * Need to explicitly implement Job.__deepcopy__. * Update changelog.
- Loading branch information
Showing
2 changed files
with
122 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters