Instrument coordinator components are garbage collectable.

Since we changed the way the ic only keeps a reference of the components via the name string, we now require that the user explicitly holds a reference to the components in memory to prevent them from being picked up by the garbage collector. This is because QCoDeS only holds a weakref to the Instruments.

A simple example:

ic= InstrumentCoordinator(...)
for driver in drivers:
  ic_comp = SomeICComp(driver)
  ic.add_component(ic_comp)

If len(drivers)>1 this results in only the last ic component added to still exist every iteration. A workaround can be assign each component to some variable, or append to a list. Then an explicit reference still exists, so it won't get deleted, but it shouldn't be necessary and is not intuitive in the way we work with the ic components now.

A similar problem should occur when you do:

ic.add_component(SomeICComp(driver))
Edited by Damien Crielaard