Remove deepcopy steps during parameterize_notebook. #673
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 PR removes the
nb = copy.deepcopy(nb)
steps inside parameterize.py and execute.py. This does not fix any tracked issue I know of. What this PR solves are some issues and annoyances surrounding the deepcopy (and pickle) standard libraries.Currently, notebooks that contain cells or parameters with objects without a __dict__ require some heavy object/class patching of their magic methods. Also, anything that is unable to be serialized with pickle will run into issues here as well. Removing all of the
copy.deepcopy(nb)
calls fixes this issue.The removal of these can be done safely because the deepcopy currently has no useful behavior; just looking at the code surrounding these calls makes it somewhat apparent. All tests are currently passing on my machine with the removal of these calls to deepcopy, so there would have to be some undocumented use-cases with no matching tests if there are any issues here.