compas-dev / compas_robots

Basic infrastructure for working with robots in COMPAS.
http://compas.dev/compas_robots/
MIT License
1 stars 5 forks source link

Bugfix/robotmodel copy recursion #20

Closed yck011522 closed 1 month ago

yck011522 commented 2 months ago

So I encountered a error when I want make a deep copy of a RobotModel. Then I notice that since we adopted compas.Data, we never tested the copy mechanism and the correctness of its result.

I have nailed down the error to how deepcopy treats objects when they are in a dictionary, and for some reason beyond my comprehension, there is a _deepcopy_dict function inside Python that is not happy with how we modified the ProxyObject.__get_attr__, this resulted in a recursion error when the ProxyObject is being deepcopied.

By introducing the __deep_copy__ function, somehow it breaks this loop.

By the way, as discussed with @gonzalocasas , we will drop support for Python 3.8 because of EOL, and we will update the requirements for compas to 2.3 to match accordingly. I'm not sure if this will requires a major version release?

What type of change is this?

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.