DiCarloLab-Delft / PycQED_py3

Python3 version of PycQED using QCoDeS as backend
MIT License
68 stars 41 forks source link

Measurement control casts sweeping points to float when input is integer #599

Closed caenrigen closed 4 years ago

caenrigen commented 4 years ago

If you encounter a bug use the following template. If you have a feature request feel free to freestyle.

Steps to reproduce

  1. Create a dummy manual parameter that accepts only integers
  2. Try to sweep it with measurement control

Expected behaviour

Expected to not cast the type of input points

Actual behaviour

It casts the points to float and therefore it would not be possible to set the parameter

System

operating system macOS PycQED branch develop

AdriaanRol commented 4 years ago

@caenrigen , it does indeed do this. The reason it does this has to do with the data saving format and the live plotting. It is actually a change that is somewhere deep in the code.

Being pythonic, I would expect the quantity/parameter being set to do the auto conversion upon receiving the float that is an int. Could you give me the example where you are encountering this as a problem?

caenrigen commented 4 years ago

@AdriaanRol I wanted to have "number of gates" in the cz simulation as a sweep parameter, and expected an integer in the simulation code, and even though the the sweep point provided to MC were integers, the simulation code ended up receiving floats. The workaround was to cast to integer in the simulation code.

caenrigen commented 4 years ago

I believe I fixed this with commit 900b43946c10704a18ebd25661eccc07121bf5fb Hope nothing else breaks Please let me know if you find difficulties due to this changes