From c4afe448d31025f51148a74ae8a91be57338b826 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Tue, 18 Jun 2024 00:02:25 -0400 Subject: fix no firstSeparator case, we return prefix=None now and process the rest --- qolab/hardware/scpi.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'qolab/hardware') diff --git a/qolab/hardware/scpi.py b/qolab/hardware/scpi.py index 8564177..a9641cf 100644 --- a/qolab/hardware/scpi.py +++ b/qolab/hardware/scpi.py @@ -15,11 +15,12 @@ def response2numStr(strIn, firstSeparator=None, unit=None): # i.e. " # prefix='TDIV', firstSeparator=' ', numberString='2.00E-08', unit='S' # this function parses the reply - if firstSeparator is None or firstSeparator == '': - return (strIn, None, None) - spltStr = re.split(firstSeparator, strIn) - prefix = spltStr[0] - rstr = spltStr[1] + prefix = None + rstr = strIn + if firstSeparator is not None and firstSeparator != '': + spltStr = re.split(firstSeparator, strIn) + prefix = spltStr[0] + rstr = spltStr[1] if unit is not None and unit != '': spltStr = re.split(unit, rstr) if len(spltStr) == 1: -- cgit v1.2.3