labscript-suite / labscript-devices

A modular and extensible plugin architecture to control experiment hardware using the 𝘭𝘒𝘣𝘴𝘀𝘳π˜ͺ𝘱𝘡 𝘴𝘢π˜ͺ𝘡𝘦.
http://labscriptsuite.org
Other
5 stars 58 forks source link

Update to fix AI error that sometimes appears in nidaqmx. #78

Closed ispielma closed 2 years ago

ispielma commented 3 years ago

This pull request is in response to errors like this that we occasionally see:

Traceback (most recent call last):
  File "c:\programdata\miniconda3\envs\py36\lib\site-packages\labscript_devices\NI_DAQmx\blacs_workers.py", line 579, in transition_to_manual
    self.extract_measurements(raw_data, waits_in_use)
  File "c:\programdata\miniconda3\envs\py36\lib\site-packages\labscript_devices\NI_DAQmx\blacs_workers.py", line 639, in extract_measurements
    data['t'] = times
ValueError: could not broadcast input array from shape (160188) into shape (160000)

It seems that this results from the times produced by summing the waits being wrong and as a result the computed length of the AI is larger than the length of the measurements array. This pull request changes the logic so that the times array is always the same length as the values array and the data array.

I don't understand the underlying hardware issue, but it seems that the times reported by the wait monitor are slightly off in some cases .

philipstarkey commented 3 years ago

I think this bug also affects experiments without waits too, see #1. But it looks like your fix isn't specific to waits which is fantastic. It will be good to see our longest standing bug go away!

dihm commented 2 years ago

@ispielma I'm looking to clear out some old PRs that are ready to go and this one fits the bill. Given what Phil and Chris have said, I'm happy to merge, but figured I confirm with you first that you've been running this edit in your labs and everything is still fine?

ispielma commented 2 years ago

David,

Yes, we have been running with this change fo a while.

β€” Ian

Ian B. Spielman

Fellow, Joint Quantum Institute National Institute of Standards and Technology and the University of Maryland

----- WEB ----- http://ultracold.jqi.umd.edu

----- EMAIL ----- @.***

----- ZOOM ----- https://umd.zoom.us/j/7984811536

----- PHONE ----- (301) 246-2482

----- MAIL ----- UMD: 2207 Computer & Space Sciences Bldg. College Park, MD 20742

NIST: 100 Bureau Drive, Stop 8424 Gaithersburg, MD 20899-8424 USA

----- OFFICE ----- UMD: Physical Sciences Complex, Room 2153 NIST: Building 216, Room B131

On Nov 8, 2021, at 09:50, David Meyer @.***> wrote:

@ispielma I'm looking to clear out some old PRs that are ready to go and this one fits the bill. Given what Phil and Chris have said, I'm happy to merge, but figured I confirm with you first that you've been running this edit in your labs and everything is still fine?

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

dihm commented 2 years ago

Superb! Merging.