microsoft/Qcodes

Error when importing Agilent 34400A introduced with "recent" commit

edumur opened this issue · 0 comments

Hi all,

After one of my student updated his Qcodes repository on his computer, he got the following error while importing the Agilent 34400A driver:

TypeError Traceback (most recent call last)
<ipython-input-2-5ff6cb0e0787> in <module>
----> 1 agilent24 = Agilent_34400A.Agilent_34400A(name='dmm1',address="GPIB::24")

qcodes\qcodes\instrument\base.py in __call__(cls, args, kwargs)
515 successfully.
516 """
--> 517 new_inst = super().__call__(args, kwargs)
518 is_abstract = new_inst._is_abstract()
519 if is_abstract:

qcodes\qcodes\instrument_drivers\agilent\Agilent_34400A.py in __init__(self, name, address, kwargs)
36 set_cmd=self._set_resolution,
37 label="Resolution",
---> 38 unit="V",
39 )

We tracked back what caused this error to this commit: 4c1001a.

Indeed, if we replace:

        self.resolution = Parameter(
            "resolution",
            get_cmd="VOLT:DC:RES?",
            get_parser=float,
            set_cmd=self._set_resolution,
            label="Resolution",
            unit="V",
        )

by:

        self.add_parameter('resolution',
                           get_cmd='VOLT:DC:RES?',
                           get_parser=float,
                           set_cmd=self._set_resolution,
                           label='Resolution',
                           unit='V')

The import works again.

operating system
Windows 10

If you are using a released version of qcodes (recommended):
qcodes version
'0.32.0.dev385+master.g465d59939c.dirty'

If you are using the development version of qcodes:
qcodes branch
master
qcodes commit
3a6571d