Skip to content

Commit f5fd15c

Browse files
authored
Merge pull request #7866 from jenshnielsen/keithley_typesafe
Small improvments to Keithley drivers
2 parents a6e8211 + 9fc3772 commit f5fd15c

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

src/qcodes/instrument_drivers/Keithley/Keithley_2000.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,6 @@ def __init__(
209209
)
210210
"""Parameter amplitude"""
211211

212-
self.add_function("reset", call_cmd="*RST")
213-
214212
if reset:
215213
self.reset()
216214

@@ -220,6 +218,9 @@ def __init__(
220218

221219
self.connect_message()
222220

221+
def reset(self) -> None:
222+
self.write("*RST")
223+
223224
def trigger(self) -> None:
224225
if not self.trigger_continuous():
225226
self.write("INIT")

src/qcodes/instrument_drivers/Keithley/Keithley_2450.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def get_selected(self) -> list[Any] | None:
4545
return self._user_selected_data
4646

4747

48-
class Keithley2450Buffer(InstrumentChannel):
48+
class Keithley2450Buffer(InstrumentChannel["Keithley2450"]):
4949
"""
5050
Treat the reading buffer as a submodule, similar to Sense and Source
5151
"""
@@ -379,7 +379,7 @@ def _set_user_delay(self, value: float) -> None:
379379
self.write(set_cmd)
380380

381381

382-
class Keithley2450Source(InstrumentChannel):
382+
class Keithley2450Source(InstrumentChannel["Keithley2450"]):
383383
"""
384384
The source module of the Keithley 2450 SMU.
385385

src/qcodes/instrument_drivers/Keithley/Keithley_7510.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def get_raw(self) -> npt.NDArray:
8484
return np.linspace(start, stop, n_points)
8585

8686

87-
class Keithley7510Buffer(InstrumentChannel):
87+
class Keithley7510Buffer(InstrumentChannel["Keithley7510"]):
8888
"""
8989
Treat the reading buffer as a submodule, similar to Sense.
9090
"""
@@ -419,7 +419,7 @@ class _FunctionMode(TypedDict):
419419
range_vals: Numbers | None
420420

421421

422-
class Keithley7510Sense(InstrumentChannel):
422+
class Keithley7510Sense(InstrumentChannel["Keithley7510"]):
423423
function_modes: ClassVar[dict[str, _FunctionMode]] = {
424424
"voltage": {
425425
"name": '"VOLT:DC"',
@@ -455,7 +455,7 @@ class Keithley7510Sense(InstrumentChannel):
455455

456456
def __init__(
457457
self,
458-
parent: VisaInstrument,
458+
parent: "Keithley7510",
459459
name: str,
460460
proper_function: str,
461461
**kwargs: "Unpack[InstrumentBaseKWArgs]",
@@ -630,7 +630,7 @@ def clear_trace(self, buffer_name: str = "defbuffer1") -> None:
630630
self.write(f":TRACe:CLEar '{buffer_name}'")
631631

632632

633-
class Keithley7510DigitizeSense(InstrumentChannel):
633+
class Keithley7510DigitizeSense(InstrumentChannel["Keithley7510"]):
634634
"""
635635
The Digitize sense module of the Keithley 7510 DMM.
636636
"""
@@ -649,7 +649,7 @@ class Keithley7510DigitizeSense(InstrumentChannel):
649649
},
650650
}
651651

652-
def __init__(self, parent: VisaInstrument, name: str, proper_function: str) -> None:
652+
def __init__(self, parent: "Keithley7510", name: str, proper_function: str) -> None:
653653
super().__init__(parent, name)
654654

655655
self._proper_function = proper_function

0 commit comments

Comments
 (0)