Open sphh opened 3 years ago
Thanks for the bug report.
copy.copy
and copy.deepcopy
won't copy the caches (defined in abstract.GeomdlBase
) but it seems it won't reinitialize the caches too. I think removing [:]
should work fine for now from the reset
method of the base and surface container classes. I'll also need to port this to geomdl 6.x if I haven't fixed it already.
Alternatively, it could be possible to move the cache functionality to __new__
magic method as the parent class calls __new__
during copy and deepcopy. This might be a better solution but I'll check it thoroughly and make sure that it won't break anything.
I'll try to push an update this weekend.
I tried your approach and removed [:]
. That also works for me. Thanks!
Describe the bug I have a
multi.SurfaceContainer
with two surfaces. After making a copy withcopy.deepcopy()
I cannot set thedelta
value.To Reproduce Steps to reproduce the behavior:
Expected Behavior Not throwing any error.
Configuration:
Additional Details (Optional)
My solution is (
multi.py
):