labscript-suite / labscript

The 𝗹𝗮𝗯𝘀𝗰𝗿𝗶𝗽𝘁 library provides a translation from expressive Python code to low-level hardware instructions.
http://labscriptsuite.org
BSD 2-Clause "Simplified" License
9 stars 51 forks source link

Bugfix for ValueError introduced in #68 #70

Closed rpanderson closed 4 years ago

rpanderson commented 4 years ago

68 introduced a bug as the == comparison with array[0] raised ValueError.

chrisjbillington commented 4 years ago

It's not just an abbreviation, isinstance(np.array(0), np.ndarray) returns True so would have failed the unabbreviated equality check even though np.array(0) is a valid scalar that ought to be considered equal to zero. So this is better.