konrad
konrad copied to clipboard
RCE class modifies input atmosphere
The RCE
class changes the values of the input atmosphere:
https://github.com/atmtools/konrad/blob/21e6c81f08f0ba1b093d5e6167c291296031f56b/konrad/core.py#L409
This can have unexpected side effects if a user wants to do several RCE runs (even with newly created RCE instances) consecutively with the same input atmosphere.
To prevent side effects, it would be preferable to make a deepcopy
of the input atmosphere when initializing the RCE
class:
https://github.com/atmtools/konrad/blob/21e6c81f08f0ba1b093d5e6167c291296031f56b/konrad/core.py#L157
If this is not desirable for other reasons, the documentation of the atmosphere parameter should at least contain a clear warning that this class will modify the input variable.