From 27b78947ee4928aa7a76f2fd40ebc606ed493cc9 Mon Sep 17 00:00:00 2001 From: jherkenhoff <22686781+jherkenhoff@users.noreply.github.com> Date: Fri, 11 Aug 2023 00:09:58 +0200 Subject: [PATCH] CAEN imrange getter and setter datatypes are now consistent (#37) * CAEN imrange getter and setter datatypes are now consistent * Update CAEN imrange setter and getter type hints --------- Co-authored-by: Luis Antonio Obis Aparicio <35803280+lobis@users.noreply.github.com> --- src/hvps/devices/caen/channel.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hvps/devices/caen/channel.py b/src/hvps/devices/caen/channel.py index 1a44027..4701c1b 100644 --- a/src/hvps/devices/caen/channel.py +++ b/src/hvps/devices/caen/channel.py @@ -150,7 +150,7 @@ def imon(self) -> float: return float(response) @property - def imrange(self) -> bool: + def imrange(self) -> str: response = _write_command( ser=self._serial, logger=self._logger, @@ -159,7 +159,7 @@ def imrange(self) -> bool: ) if response not in ["HIGH", "LOW"]: raise ValueError(f"Unexpected response {response}") - return response == "HIGH" + return response @property def imdec(self) -> int: @@ -485,7 +485,8 @@ def pdwn(self, value: float) -> None: raise ValueError(f"Could not set PDWN to {value}") @imrange.setter - def imrange(self, value: float) -> None: + def imrange(self, value: str) -> None: + """Set channel to "HIGH" or "LOW" current monitor mode""" _write_command( ser=self._serial, logger=self._logger,