convexengineering / gpkit

Geometric programming for engineers
http://gpkit.readthedocs.org
MIT License
206 stars 40 forks source link

Best way to track "parents" of operations such as posy.chop or constraint.as_posyslt1() #1451

Closed 1ozturkbe closed 4 years ago

1ozturkbe commented 4 years ago

This is a design discussion @bqpd since I will need to do this for some new functionality I'm planning for robust. I would like to track the original parents of each new constraint or GPkit object created in robust so I can easily call some attributes of the parents. I could do this by adding .parent to every robust object AND every gpkit object, but that seems horrendously cumbersome. Is there any code magic that can be done instead?

bqpd commented 4 years ago

yup, I'd just add .parent! that is the magic! everything is a linked list 🤩

bqpd commented 4 years ago

a lot of .parent in https://github.com/convexengineering/gpkit/pull/1463