From b509c246a9d8a93b2f70b6f205ac3bf14d03d4fa Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Mon, 17 Jun 2024 23:52:35 -0400 Subject: bug fix for the unit detection in response2numStr --- qolab/hardware/scpi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3