Closed masci closed 1 year ago
I'm ok with this change as long as we are a bit more proactive with the checks. Let's add a check in add_component
to make sure the instance is not present already in the graph and returns a meaningful error to the user. Otherwise this can cause hard-to-trace bugs imho, because it doesn't fail but just causes side effects.
Let's add a check in add_component to make sure the instance is not present already in the graph
We can do this in another PR, I just fixed the tests because they were wrong and I stumbled upon them working on the refactoring
Simplify code and remove side effects from sharing a mutable container.