-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Negative Delay #13
Comments
That sounds reasonable, 0 or None suppressing delay warnings. I'd rather not allow users to omit delay though - would be too easy to do accidentally, which can sometimes actually break things. |
Do you have an example of this? I would argue that delay=None should be the default option unless there is a strong argument why that is a really bad idea. |
It's not going to break things in code... I just mean like ramping certain parameters too fast can break a device. |
Shouldn't this rather go into the driver, as opposed to the measurement loop? |
Should that not be set in the instrument driver itself? I think the alternative you are proposing, which is setting the delay in the loop is far more error prone, I see it going wrong in two ways, the first is accidently forgetting a zero in the delay you set, the second is people copy pasting and forgetting about it altogether. |
Ah yes, it could go in the driver via an init script... that's a good idea. I think it's generally not a good idea for this to be part of the drivers themselves, because it will vary by experiment, but if the instrument itself cares requires some delay for safety then I guess it can be put in the driver. Or for simulations where you know delays are useless they can be preset to zero. How about this:
|
I would like to prevent introducing to much new complexity. I think there are two reasons why you would want to specify a delay. 1. Device/experiment safety reasons and 2. "Experiment" loop specific considerations. For option 1 we have a perfectly fine way of specifying this in the instrument driver, the enhancement I would propose would be the ability to change this either upon initialization or after initialization of an instrument. For option 2 it belongs in the loop, however zero (0) is the sensible default if it is not specified. Adding a new To summarize I propose the following:
|
you mean and re: changing these after initialization - yes, there's a |
@alexcjohnson is there somehow a fix for this? Or anything I can do until there is a real fix? |
Same here, printing the warning statements seems to be the major bottleneck for speed of my notebooks. |
Almost ready with a PR on this... |
@MerlinSmiles @damazter this should be resolved by microsoft/Qcodes#116 - closing, but feel free to reopen if issues persist. |
@alexcjohnson I still see these negative delays, during my measurements. I guess I didnt see this for a long time because I removed that warning in my local copy 👼 |
negative delays still happen and it's totally not clear what they mean IMHO. |
This issue might be related to microsoft/Qcodes#44 and microsoft/Qcodes#47
upon writing a numerical simulation as an instrument several problems occurred (described in separate issues)
I want to sweep over some numerical parameter such the energy of the system and measure some transmission property. the loop i wrote is:
where
system
is the variable containing the numerical simulation instrument(the background=false is part of a separate issue)
upon running this code i get the same warning as @AdriaanRol got before:
WARNING:root:negative delay -0.000041 sec
In the case of such loops (containing numerical work rather than experiments) I feel that there should be some easy/trivial way to remove this sort of delays from the loop without causing this warning.
I feel that this behavior should be default for the syntaxes:
I understand that this warning is very important in some loops, but that is only the case if delay>0.
For loops not containing a delay, the actual time taken will always be larger than 0 and the warning is meaningless.
The text was updated successfully, but these errors were encountered: