labscript-suite-temp / blacs

BLACS, part of the labscript suite, provides an interface to hardware used to control a buffered experiment. It manages a queue of shots to be run as well as providing manual control over devices between shots.
Other
0 stars 0 forks source link

Devices with broken code break BLACS (even though we supposedly fixed this) #48

Closed philipstarkey closed 5 years ago

philipstarkey commented 5 years ago

Original report (archived issue) by Philip Starkey (Bitbucket: pstarkey, GitHub: pstarkey).


The code to gracefully handle device tabs that raise exceptions (when they are instantiated) is broken. It modifies the dictionary we are iterating over, which then raises it's own exception (at least under Python 3.6).

We should store the devices to remove in a list, and then remove them after we have attempted to initialise each device tab.

See lines 277 and 291 here

philipstarkey commented 5 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Ah yes. .items() doesn't make a copy of a dict in Python 3.

for device_name, labscript_device_class_name in list(self.attached_devices.items()): should be sufficient to fix the problem.

philipstarkey commented 5 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Fix issue #48

→ \<\<cset 382e92880a5b1d473072538a3ef2b23ca734f0c1>>

philipstarkey commented 5 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Merged in cbillington/blacs/bugfix (pull request #55)

Fix issue #48

→ \<\<cset 5a4ca1d6dbc1f065fd895c69efe88a45caf30fde>>

philipstarkey commented 5 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Merged in cbillington/blacs/bugfix (pull request #55)

Fix issue #48

→ \<\<cset 5a4ca1d6dbc1f065fd895c69efe88a45caf30fde>>