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/ ...@@ -13,7 +13,7 @@ measurement/activeline/controllers/
import logging import logging
from enum import Enum, IntEnum 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 .base import SingleCommDevice
from ..comm import SerialCommunication, SerialCommunicationConfig from ..comm import SerialCommunication, SerialCommunicationConfig
...@@ -409,7 +409,7 @@ class PfeifferTPG(SingleCommDevice): ...@@ -409,7 +409,7 @@ class PfeifferTPG(SingleCommDevice):
logging.info(f"Reading all sensors with result: {ret}.") logging.info(f"Reading all sensors with result: {ret}.")
return 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 Set the full scale range of the attached sensors. See lookup table between
command and corresponding pressure in the device user manual. command and corresponding pressure in the device user manual.
...@@ -449,7 +449,7 @@ class PfeifferTPG(SingleCommDevice): ...@@ -449,7 +449,7 @@ class PfeifferTPG(SingleCommDevice):
logging.error("Setting sensors full scale failed.") logging.error("Setting sensors full scale failed.")
raise e 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 Get the full scale range of the attached sensors. See lookup table between
command and corresponding pressure in the device user manual. command and corresponding pressure in the device user manual.
...@@ -499,7 +499,7 @@ class PfeifferTPG(SingleCommDevice): ...@@ -499,7 +499,7 @@ class PfeifferTPG(SingleCommDevice):
:raises SerialCommunicationIOError: when communication port is not opened :raises SerialCommunicationIOError: when communication port is not opened
:raises PfeifferTPGError: if command fails :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]: def get_full_scale_unitless(self) -> List[int]:
""" """
...@@ -510,7 +510,7 @@ class PfeifferTPG(SingleCommDevice): ...@@ -510,7 +510,7 @@ class PfeifferTPG(SingleCommDevice):
:raises SerialCommunicationIOError: when communication port is not opened :raises SerialCommunicationIOError: when communication port is not opened
:raises PfeifferTPGError: if command fails :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: def set_full_scale_mbar(self, fsr: List[Number]) -> None:
""" """
......
Supports Markdown
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