DiCarloLab-Delft / PycQED_py3

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

Misplaced arguments and bad code behaviour #630

Open tstavenga opened 4 years ago

tstavenga 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

In the qubit object the function: def calibrate_ssro_coarse(self, MC=None, nested_MC=None, freqs=None, amps=None, analyze: bool = True, update: bool = True): should definitely not have either MC or nested_MC as its arguments

Expected behaviour

They should be extracted from the qubit object, the instr_nested_MC has the relevant data in the qubit object

Actual behaviour

You have to put it manually for some reason, this is a bad code desing mistake. also quite obvious.

wvlothuizen commented 2 years ago

The offending function is identical in this respect to many other functions: MC and (sometimes) nested_MC are provided as parameters that can override the default, as in the typical code below:

        if MC is None:
            MC = self.instr_MC.get_instr()

        if nested_MC is None:
            nested_MC = self.instr_nested_MC.get_instr()

The reason to provide this override is unclear to me, I haven't seen uses of it. It could be a way to have separate visualisation (which is part of MC).