aboutsummaryrefslogtreecommitdiff
path: root/qolab
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2024-06-17 23:52:35 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2024-06-17 23:52:35 -0400
commitb509c246a9d8a93b2f70b6f205ac3bf14d03d4fa (patch)
tree306bb3239299ee646157e93b210ae5da781dc660 /qolab
parent3caa835b22b6ba07481b272a32cab8daeb6b3f02 (diff)
downloadqolab-b509c246a9d8a93b2f70b6f205ac3bf14d03d4fa.tar.gz
qolab-b509c246a9d8a93b2f70b6f205ac3bf14d03d4fa.zip
bug fix for the unit detection in response2numStr
Diffstat (limited to 'qolab')
-rw-r--r--qolab/hardware/scpi.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/qolab/hardware/scpi.py b/qolab/hardware/scpi.py
index 328e261..8564177 100644
--- a/qolab/hardware/scpi.py
+++ b/qolab/hardware/scpi.py
@@ -22,8 +22,9 @@ def response2numStr(strIn, firstSeparator=None, unit=None):
rstr = spltStr[1]
if unit is not None and unit != '':
spltStr = re.split(unit, rstr)
+ if len(spltStr) == 1:
+ unit = None
numberString = spltStr[0]
- unit = spltStr[1]
else:
numberString = rstr
return (prefix, numberString, unit)