• Sean's avatar
    Fix bug with deepcopy · 65bbad6a
    Sean authored
    When deepcopying a circuit, the nodes were also deepcopied. This is a problem because
    nodes are supposed to be singletons. When the user wanted to analyse a deepcopied
    circuit that had previously been analysed, the input component would be added with
    different nodes even though those nodes would exist in the circuit already (same
    name, but different memory locations), leading to singular matrices when solving.
    The fix is to implement special deepcopy behaviour for circuits using __deepcopy__.
    This is not ideal; it might be worth removing the singleton property of nodes and
    make them circuit-specific.
circuit.py 20.6 KB