From 645f0a962f64b28ee34c826eab7b6f738c544347 Mon Sep 17 00:00:00 2001 From: Mikhail Astafev Date: Fri, 5 May 2023 12:34:58 +0200 Subject: [PATCH 1/3] Fix Keithley 3706A driver to refer to the new interlock status string from #5013 --- .../instrument_drivers/Keithley/Keithley_3706A.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/qcodes/instrument_drivers/Keithley/Keithley_3706A.py b/qcodes/instrument_drivers/Keithley/Keithley_3706A.py index 4e6d7b6fc02..ca1a7aa78c9 100644 --- a/qcodes/instrument_drivers/Keithley/Keithley_3706A.py +++ b/qcodes/instrument_drivers/Keithley/Keithley_3706A.py @@ -137,7 +137,7 @@ def close_channel(self, val: str) -> None: ) if val in forbidden_channels.split(","): warnings.warn( - "You are attempting to close channels that are " "forbidden to close.", + "You are attempting to close channels that are forbidden to close.", UserWarning, 2, ) @@ -165,10 +165,10 @@ def _warn_on_disengaged_interlocks(self, val: str) -> None: interlock_state = [ state for state in states if state["slot_no"] == slot ][0] - if interlock_state["state"] == "Interlock is disengaged": + if interlock_state["state"] == "Interlocks 1 and 2 are disengaged on the card": warnings.warn( - f"The hardware interlock in Slot " - f'{interlock_state["slot_no"]} is disengaged. ' + f"The hardware interlocks in Slot " + f'{interlock_state["slot_no"]} are disengaged. ' f"The analog backplane relay {channel} " "cannot be energized.", UserWarning, @@ -395,10 +395,10 @@ def set_backplane(self, val: str, backplane: str) -> None: plane_specifiers = backplane.split(",") val_specifiers = val.split(",") for element in states: - if element["state"] == "Interlock is disengaged": + if element["state"] == "Interlocks 1 and 2 are disengaged on the card": warnings.warn( - f"The hardware interlock in Slot " - f'{element["slot_no"]} is disengaged. ' + f"The hardware interlocks in Slot " + f'{element["slot_no"]} are disengaged. ' "The corresponding analog backplane relays " "cannot be energized.", UserWarning, From e5a97ebaaa944b689f178c7a28c86c3fa2d3d45d Mon Sep 17 00:00:00 2001 From: Mikhail Astafev Date: Fri, 5 May 2023 12:38:16 +0200 Subject: [PATCH 2/3] Create 5147.improved_driver --- docs/changes/newsfragments/5147.improved_driver | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/changes/newsfragments/5147.improved_driver diff --git a/docs/changes/newsfragments/5147.improved_driver b/docs/changes/newsfragments/5147.improved_driver new file mode 100644 index 00000000000..4308a6cea0e --- /dev/null +++ b/docs/changes/newsfragments/5147.improved_driver @@ -0,0 +1,2 @@ +Fix Keithley 3706A driver to use the updated interlock status strings +(following up on :pr:`5007`) From 9f4320a155273771c618f7de9176510378eb2cd1 Mon Sep 17 00:00:00 2001 From: Mikhail Astafev Date: Fri, 5 May 2023 12:40:44 +0200 Subject: [PATCH 3/3] improve formatting --- qcodes/instrument_drivers/Keithley/Keithley_3706A.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qcodes/instrument_drivers/Keithley/Keithley_3706A.py b/qcodes/instrument_drivers/Keithley/Keithley_3706A.py index ca1a7aa78c9..2546fa098ef 100644 --- a/qcodes/instrument_drivers/Keithley/Keithley_3706A.py +++ b/qcodes/instrument_drivers/Keithley/Keithley_3706A.py @@ -165,7 +165,10 @@ def _warn_on_disengaged_interlocks(self, val: str) -> None: interlock_state = [ state for state in states if state["slot_no"] == slot ][0] - if interlock_state["state"] == "Interlocks 1 and 2 are disengaged on the card": + if ( + interlock_state["state"] + == "Interlocks 1 and 2 are disengaged on the card" + ): warnings.warn( f"The hardware interlocks in Slot " f'{interlock_state["slot_no"]} are disengaged. '