Skip to content

Commit 1a235aa

Browse files
NI_DAQmx: Uniformity in how AO and DO tables are checked for being all zero.
not np.any(A) is more memory efficient than np.all(A==0), as it doesn't have to construct the intermediate array of bools.
1 parent 1c377cc commit 1a235aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

NI_DAQmx/blacs_workers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def program_buffered_AO(self, AO_table):
277277
# Check if AOs are all zero for the whole shot. If they are this triggers a
278278
# bug in NI-DAQmx that throws a cryptic error for buffered output. In this
279279
# case, run it as a non-buffered task.
280-
self.AO_all_zero = all(AO_table.flatten() == 0)
280+
self.AO_all_zero = not np.any(AO_table)
281281
if self.AO_all_zero:
282282
AO_table = AO_table[0:1]
283283

0 commit comments

Comments
 (0)