sous chef return deep copies of cached objects #484
Merged
+72
−9
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.
Description of work
It was possible for code in SNAPRed to edit the cached ingredients objects in SousChef, resulting in globally different sets of parameters.
This fixes that.
Explanation of work
Used
deepcopy
of the cached objects to prevent the original being overwritten.Shallow copies cannot work here, as it is still possible to change things in a shallow copy that reflect in the original.
There are new tests to ensure the cached objects cannot be changed.
To test
Dev testing
Run diffcal, save, continue, run again same run, at tweak peak stage make sure the same peaks are there and same settings.
Run normal, make sure the tweak peak stage appears. If so, should be good.
Double check the unit tests.
CIS testing
N/A, but will be apparent in testing of PR #480
Link to EWM item
No ticket, but arose in development:
EWM#7388
Was discovered during testing of PR #480
Verification
N/A
Acceptance Criteria
N/A