To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 2dad1933 authored by mikolajr's avatar mikolajr
Browse files

In PfeifferTPG device: fix type check errors

parent caa33dd1
......@@ -13,7 +13,7 @@ measurement/activeline/controllers/
import logging
from enum import Enum, IntEnum
from typing import Dict, List, Tuple, Union
from typing import Dict, List, Tuple, Union, cast
from .base import SingleCommDevice
from ..comm import SerialCommunication, SerialCommunicationConfig
......@@ -409,7 +409,7 @@ class PfeifferTPG(SingleCommDevice):
logging.info(f"Reading all sensors with result: {ret}.")
return ret
def _set_full_scale(self, fsr: List[int], unitless: bool) -> None:
def _set_full_scale(self, fsr: List[Number], unitless: bool) -> None:
"""
Set the full scale range of the attached sensors. See lookup table between
command and corresponding pressure in the device user manual.
......@@ -449,7 +449,7 @@ class PfeifferTPG(SingleCommDevice):
logging.error("Setting sensors full scale failed.")
raise e
def _get_full_scale(self, unitless: bool) -> List[int]:
def _get_full_scale(self, unitless: bool) -> List[Number]:
"""
Get the full scale range of the attached sensors. See lookup table between
command and corresponding pressure in the device user manual.
......@@ -499,7 +499,7 @@ class PfeifferTPG(SingleCommDevice):
:raises SerialCommunicationIOError: when communication port is not opened
:raises PfeifferTPGError: if command fails
"""
self._set_full_scale(fsr, True)
self._set_full_scale(cast(List[Number], fsr), True)
def get_full_scale_unitless(self) -> List[int]:
"""
......@@ -510,7 +510,7 @@ class PfeifferTPG(SingleCommDevice):
:raises SerialCommunicationIOError: when communication port is not opened
:raises PfeifferTPGError: if command fails
"""
return self._get_full_scale(True)
return cast(List[int], self._get_full_scale(True))
def set_full_scale_mbar(self, fsr: List[Number]) -> None:
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment