Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Process: Ensure that the raw inputs are not mutated (#251)
The `Process.raw_inputs` property returns an `AttributesFrozenDict` instance with the inputs that were originally passed to the constructor of the process instance. These inputs should not be mutated as the final inputs are generated from it by pre-processing them with respect to the process spec, filling in defaults for missing ports. However, the `spec().inputs.pre_process` call in `on_create` was passing a shallow copy of the `raw_inputs` and so nested dictionaries would get modified. The problem is fixed by passing in a deep copy instead. This is done using a custom inline function `recursively_copy_dictionaries` instead of the maybe more obvious choice `copy.deepcopy`. The reason is that the latter not only copies the namespaces but also the values, which is not what we want here because we want to maintain the original values.
- Loading branch information