MeasurementControl safety features to protect user against wrong inputs
It is possible for a user to (by mistake) start an experiment with ~100M different setpoints. An experiment this large is likely not intended by the user and will crash the data visualization.
I think it makes sense to provide some safety mechanism where the input of the MC is validated to prevent this user error. The tricky bit is that a user might also want to do this on purpose (and disable the live plotting for instance).
I propose we add a max size to the setpoints. When a user inputs an array larger than this a ValueError
is raised with a clear message why this is raised. This message should also include an instruction on how to disable this safety mechanism. This could either be an argument to the .run()
method, or a parameter that can be configured on the meas_ctrl.
As an example of what triggered this problem for me
f_span = 200e6
f_center = 7.134524e9
f_step = 0.56 # typo, should be 0.5e6
freqs = np.arange(f_center-f_span/2, f_center+f_span/2, f_step)
meas_ctrl.set_setpoints(freqs) # I propose we should raise an exception here because freqs >> 1e6 setpoints
@maintainers, let me know if you agree with this proposed feature.