Skip to content

Commit

Permalink
CAEN imrange getter and setter datatypes are now consistent (#37)
Browse files Browse the repository at this point in the history
* CAEN imrange getter and setter datatypes are now consistent

* Update CAEN imrange setter and getter type hints

---------

Co-authored-by: Luis Antonio Obis Aparicio <[email protected]>
  • Loading branch information
jherkenhoff and lobis authored Aug 10, 2023
1 parent af2e19a commit 27b7894
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hvps/devices/caen/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 27b7894

Please sign in to comment.