Skip to content

Commit

Permalink
Improve docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed May 23, 2024
1 parent fc287d2 commit bbea473
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 27 deletions.
9 changes: 5 additions & 4 deletions src/qcodes/instrument_drivers/Keithley/Keithley_6500.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ def __init__(
reset_device: bool = False,
**kwargs: "Unpack[VisaInstrumentKWArgs]",
):
"""Driver for the Keithley 6500 multimeter. Based on the Keithley 2000 driver,
commands have been adapted for the Keithley 6500. This driver does not contain
all commands available, but only the ones most commonly used.
"""
Driver for the Keithley 6500 multimeter. Based on the Keithley 2000 driver,
commands have been adapted for the Keithley 6500. This driver does not contain
all commands available, but only the ones most commonly used.
Status: beta-version.
Status: beta-version.
Args:
name: The name used internally by QCoDeS in the DataSet.
Expand Down
51 changes: 28 additions & 23 deletions src/qcodes/instrument_drivers/Keithley/Keithley_7510.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,27 +417,6 @@ class _FunctionMode(TypedDict):


class Keithley7510Sense(InstrumentChannel):
"""
The sense module of the Keithley 7510 DMM, based on the sense module of
Keithley 2450 SMU.
Args:
parent
name
proper_function: This can be one of modes listed in the dictionary
"function_modes", e.g., "current", "voltage", or "resistance".
"voltage"/"current" is for DC voltage/current.
"Avoltage"/"Acurrent" is for AC voltage/current.
"resistance" is for two-wire measurement of resistance.
"Fresistance" is for Four-wire measurement of resistance.
All parameters and methods in this submodule should only be
accessible to the user if
self.parent.sense_function.get() == self._proper_function. We
ensure this through the 'sense' property on the main driver class
which returns the proper submodule for any given function mode.
"""

function_modes: ClassVar[dict[str, _FunctionMode]] = {
"voltage": {
"name": '"VOLT:DC"',
Expand Down Expand Up @@ -471,9 +450,35 @@ class Keithley7510Sense(InstrumentChannel):
},
}

def __init__(self, parent: VisaInstrument, name: str, proper_function: str) -> None:
def __init__(
self,
parent: VisaInstrument,
name: str,
proper_function: str,
**kwargs: "Unpack[VisaInstrumentKWArgs]",
) -> None:
"""
The sense module of the Keithley 7510 DMM, based on the sense module of
Keithley 2450 SMU.
super().__init__(parent, name)
All parameters and methods in this submodule should only be
accessible to the user if
self.parent.sense_function.get() == self._proper_function. We
ensure this through the 'sense' property on the main driver class
which returns the proper submodule for any given function mode.
Args:
parent: Parent instrument.
name: Name of the channel.
proper_function: This can be one of modes listed in the dictionary
"function_modes", e.g., "current", "voltage", or "resistance".
"voltage"/"current" is for DC voltage/current.
"Avoltage"/"Acurrent" is for AC voltage/current.
"resistance" is for two-wire measurement of resistance.
"Fresistance" is for Four-wire measurement of resistance.
**kwargs: Forwarded to base class.
"""
super().__init__(parent, name, **kwargs)

self._proper_function = proper_function
range_vals = self.function_modes[self._proper_function]["range_vals"]
Expand Down

0 comments on commit bbea473

Please sign in to comment.