SeanezLab / BoMI-StartReact

https://seanezlab.github.io/BoMI-StartReact/
0 stars 0 forks source link

Fix type errors #9

Open seasonedfish opened 1 year ago

seasonedfish commented 1 year ago

Running mypy today made me sad, we should fix these type errors eventually.

116 errors, 184 lines of output

(.venv) [fisher@workshop BoMI-StartReact]$ mypy bomI
trigno_sdk/client.py:121: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
trigno_sdk/client.py:122: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
trigno_sdk/client.py:125: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
trigno_sdk/client.py:129: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
trigno_sdk/client.py:317: error: Incompatible default for argument "savedir" (default has type "None", argument has type "Path")  [assignment]
trigno_sdk/client.py:317: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
trigno_sdk/client.py:317: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
trigno_sdk/client.py:323: error: Argument 1 to "put" of "Queue" has incompatible type "Tuple[float, ...]"; expected "Tuple[float]"  [arg-type]
trigno_sdk/client.py:332: error: Argument 1 to "put" of "Queue" has incompatible type "Tuple[float, ...]"; expected "Tuple[float]"  [arg-type]
trigno_sdk/client.py:353: error: Argument 1 to "asdict" has incompatible type "Optional[EMGSensor]"; expected "DataclassInstance"  [arg-type]
bomi/device_managers/table_model.py:29: error: Attribute "devices" already defined on line 24  [no-redef]
bomI/device_managers/table_model.py:29: error: Attribute "devices" already defined on line 24  [no-redef]
bomi/base_widgets.py:57: error: Incompatible default for argument "name" (default has type "None", argument has type "str")  [assignment]
bomi/base_widgets.py:57: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
bomi/base_widgets.py:57: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
bomi/base_widgets.py:59: error: Incompatible default for argument "callback" (default has type "None", argument has type "Callable[[], None]")  [assignment]
bomi/base_widgets.py:59: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
bomi/base_widgets.py:59: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
bomi/base_widgets.py:106: error: Argument 1 to "setCurrentText" of "QComboBox" has incompatible type "Union[Any, Literal[_MISSING_TYPE.MISSING]]"; expected "str"  [arg-type]
bomi/base_widgets.py:114: error: Argument 1 to "setText" of "QLineEdit" has incompatible type "Union[Any, Literal[_MISSING_TYPE.MISSING]]"; expected "str"  [arg-type]
bomi/base_widgets.py:122: error: Argument 1 to "setValue" of "QSpinBox" has incompatible type "Union[Any, Literal[_MISSING_TYPE.MISSING]]"; expected "int"  [arg-type]
bomi/base_widgets.py:122: error: Argument 1 to "setValue" of "QDoubleSpinBox" has incompatible type "Union[Any, Literal[_MISSING_TYPE.MISSING]]"; expected "float"  [arg-type]
bomi/base_widgets.py:130: error: Argument 1 to "setChecked" of "QAbstractButton" has incompatible type "Union[Any, Literal[_MISSING_TYPE.MISSING]]"; expected "bool"  [arg-type]
bomi/base_widgets.py:207: error: Function "Callable[[], None]" could always be true in boolean context  [truthy-function]
bomi/window_mixin.py:16: error: No overload variant of "question" of "QMessageBox" matches argument types "WindowMixin", "str", "str", "Any"  [call-overload]
bomi/window_mixin.py:16: note: Possible overload variants:
bomi/window_mixin.py:16: note:     def question(parent: QWidget, title: str, text: str, button0: StandardButton, button1: StandardButton) -> int
bomi/window_mixin.py:16: note:     def question(parent: QWidget, title: str, text: str, buttons: StandardButtons = ..., defaultButton: StandardButton = ...) -> StandardButton
bomi/window_mixin.py:36: error: Cannot assign to a method  [method-assign]
bomI/window_mixin.py:16: error: No overload variant of "question" of "QMessageBox" matches argument types "WindowMixin", "str", "str", "Any"  [call-overload]
bomI/window_mixin.py:16: note: Possible overload variants:
bomI/window_mixin.py:16: note:     def question(parent: QWidget, title: str, text: str, button0: StandardButton, button1: StandardButton) -> int
bomI/window_mixin.py:16: note:     def question(parent: QWidget, title: str, text: str, buttons: StandardButtons = ..., defaultButton: StandardButton = ...) -> StandardButton
bomI/window_mixin.py:36: error: Cannot assign to a method  [method-assign]
bomI/base_widgets.py:57: error: Incompatible default for argument "name" (default has type "None", argument has type "str")  [assignment]
bomI/base_widgets.py:57: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
bomI/base_widgets.py:57: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
bomI/base_widgets.py:59: error: Incompatible default for argument "callback" (default has type "None", argument has type "Callable[[], None]")  [assignment]
bomI/base_widgets.py:59: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
bomI/base_widgets.py:59: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
bomI/base_widgets.py:106: error: Argument 1 to "setCurrentText" of "QComboBox" has incompatible type "Union[Any, Literal[_MISSING_TYPE.MISSING]]"; expected "str"  [arg-type]
bomI/base_widgets.py:114: error: Argument 1 to "setText" of "QLineEdit" has incompatible type "Union[Any, Literal[_MISSING_TYPE.MISSING]]"; expected "str"  [arg-type]
bomI/base_widgets.py:122: error: Argument 1 to "setValue" of "QSpinBox" has incompatible type "Union[Any, Literal[_MISSING_TYPE.MISSING]]"; expected "int"  [arg-type]
bomI/base_widgets.py:122: error: Argument 1 to "setValue" of "QDoubleSpinBox" has incompatible type "Union[Any, Literal[_MISSING_TYPE.MISSING]]"; expected "float"  [arg-type]
bomI/base_widgets.py:130: error: Argument 1 to "setChecked" of "QAbstractButton" has incompatible type "Union[Any, Literal[_MISSING_TYPE.MISSING]]"; expected "bool"  [arg-type]
bomI/base_widgets.py:207: error: Function "Callable[[], None]" could always be true in boolean context  [truthy-function]
threespace_api/threespace_utils.py:18: error: Skipping analyzing "serial": module is installed, but missing library stubs or py.typed marker  [import]
bomI/device_managers/qtm_manager.py:3: error: Cannot find implementation or library stub for module named "analog_streaming_client"  [import]
bomI/device_managers/qtm_manager.py:20: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomI/device_managers/qtm_manager.py:33: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomi/device_managers/trigno_widget.py:13: error: Skipping analyzing "pyqtgraph": module is installed, but missing library stubs or py.typed marker  [import]
bomi/device_managers/trigno_widget.py:80: error: Need type annotation for "_layout"  [var-annotated]
bomi/device_managers/trigno_widget.py:111: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomi/device_managers/trigno_widget.py:125: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomi/device_managers/trigno_widget.py:126: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomi/device_managers/trigno_widget.py:276: error: Incompatible default for argument "trigno_client" (default has type "None", argument has type "TrignoClient")  [assignment]
bomi/device_managers/trigno_widget.py:276: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
bomi/device_managers/trigno_widget.py:276: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
bomi/device_managers/trigno_widget.py:361: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomi/scope_widget.py:10: error: Skipping analyzing "pyqtgraph": module is installed, but missing library stubs or py.typed marker  [import]
bomi/scope_widget.py:11: error: Skipping analyzing "pyqtgraph.parametertree": module is installed, but missing library stubs or py.typed marker  [import]
bomi/scope_widget.py:15: error: Skipping analyzing "pyqtgraph.parametertree.parameterTypes": module is installed, but missing library stubs or py.typed marker  [import]
bomi/scope_widget.py:16: error: Skipping analyzing "pyqtgraph.parametertree.parameterTypes.basetypes": module is installed, but missing library stubs or py.typed marker  [import]
bomi/scope_widget.py:73: error: Incompatible default for argument "target_range" (default has type "None", argument has type "Tuple[float, float]")  [assignment]
bomi/scope_widget.py:73: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
bomi/scope_widget.py:73: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
bomi/scope_widget.py:74: error: Incompatible default for argument "base_range" (default has type "None", argument has type "Tuple[float, float]")  [assignment]
bomi/scope_widget.py:74: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
bomi/scope_widget.py:74: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
bomi/scope_widget.py:184: error: Incompatible default for argument "task_widget" (default has type "None", argument has type "TaskDisplay")  [assignment]
bomi/scope_widget.py:184: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
bomi/scope_widget.py:184: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
bomi/scope_widget.py:186: error: Incompatible default for argument "trigno_client" (default has type "None", argument has type "TrignoClient")  [assignment]
bomi/scope_widget.py:186: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
bomi/scope_widget.py:186: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
bomi/scope_widget.py:198: error: Incompatible types in assignment (expression has type "None", variable has type "TrignoClient")  [assignment]
bomi/scope_widget.py:500: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomi/scope_widget.py:503: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomi/scope_widget.py:603: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomi/scope_widget.py:660: error: Signature of "get" incompatible with supertype "Queue"  [override]
bomi/scope_widget.py:660: note:      Superclass:
bomi/scope_widget.py:660: note:          def get(self, block: bool = ..., timeout: Optional[float] = ...) -> Any
bomi/scope_widget.py:660: note:      Subclass:
bomi/scope_widget.py:660: note:          def get(self) -> None
threespace_api/__init__.py:22: error: Skipping analyzing "serial": module is installed, but missing library stubs or py.typed marker  [import]
threespace_api/__init__.py:40: error: Need type annotation for "global_donglist" (hint: "global_donglist: Dict[, ] = ...")  [var-annotated]
threespace_api/__init__.py:41: error: Need type annotation for "global_sensorlist" (hint: "global_sensorlist: Dict[, ] = ...")  [var-annotated]
threespace_api/__init__.py:918: error: Need type annotation for "reverse_command_dict" (hint: "reverse_command_dict: Dict[, ] = ...")  [var-annotated]
threespace_api/__init__.py:918: error: Argument 1 to "dict" has incompatible type "map[List[object]]"; expected "Iterable[Tuple[, ]]"  [arg-type]
threespace_api/__init__.py:2442: error: Need type annotation for "reverse_command_dict" (hint: "reverse_command_dict: Dict[, ] = ...")  [var-annotated]
threespace_api/__init__.py:2442: error: Argument 1 to "dict" has incompatible type "map[List[object]]"; expected "Iterable[Tuple[, ]]"  [arg-type]
threespace_api/__init__.py:2442: error: Argument 1 to "map" has incompatible type "Callable[[Tuple[str, Tuple[int, int, Optional[str], int, Optional[str], int]]], List[object]]"; expected "Callable[[Tuple[str, Tuple[int, int, Optional[str], int, Optional[str], int]]], Tuple[Any, Any]]"  [arg-type]
threespace_api/__init__.py:2442: error: Incompatible return value type (got "List[object]", expected "Tuple[Any, Any]")  [return-value]
threespace_api/__init__.py:2513: error: Need type annotation for "reverse_command_dict" (hint: "reverse_command_dict: Dict[, ] = ...")  [var-annotated]
threespace_api/__init__.py:2513: error: Argument 1 to "dict" has incompatible type "map[List[object]]"; expected "Iterable[Tuple[, ]]"  [arg-type]
threespace_api/__init__.py:2513: error: Argument 1 to "map" has incompatible type "Callable[[Tuple[str, Tuple[int, int, Optional[str], int, Optional[str], int]]], List[object]]"; expected "Callable[[Tuple[str, Tuple[int, int, Optional[str], int, Optional[str], int]]], Tuple[Any, Any]]"  [arg-type]
threespace_api/__init__.py:2513: error: Incompatible return value type (got "List[object]", expected "Tuple[Any, Any]")  [return-value]
threespace_api/__init__.py:3320: error: Need type annotation for "reverse_command_dict" (hint: "reverse_command_dict: Dict[, ] = ...")  [var-annotated]
threespace_api/__init__.py:3320: error: Argument 1 to "dict" has incompatible type "map[List[object]]"; expected "Iterable[Tuple[, ]]"  [arg-type]
threespace_api/__init__.py:3320: error: Argument 1 to "map" has incompatible type "Callable[[Tuple[str, Tuple[int, int, Optional[str], int, Optional[str], int]]], List[object]]"; expected "Callable[[Tuple[str, Tuple[int, int, Optional[str], int, Optional[str], int]]], Tuple[Any, Any]]"  [arg-type]
threespace_api/__init__.py:3320: error: Incompatible return value type (got "List[object]", expected "Tuple[Any, Any]")  [return-value]
threespace_api/__init__.py:3406: error: Need type annotation for "reverse_command_dict" (hint: "reverse_command_dict: Dict[, ] = ...")  [var-annotated]
threespace_api/__init__.py:3406: error: Argument 1 to "dict" has incompatible type "map[List[object]]"; expected "Iterable[Tuple[, ]]"  [arg-type]
threespace_api/__init__.py:3406: error: Argument 1 to "map" has incompatible type "Callable[[Tuple[str, Tuple[int, int, Optional[str], int, Optional[str], int]]], List[object]]"; expected "Callable[[Tuple[str, Tuple[int, int, Optional[str], int, Optional[str], int]]], Tuple[Any, Any]]"  [arg-type]
threespace_api/__init__.py:3406: error: Incompatible return value type (got "List[object]", expected "Tuple[Any, Any]")  [return-value]
threespace_api/__init__.py:3527: error: Need type annotation for "reverse_command_dict" (hint: "reverse_command_dict: Dict[, ] = ...")  [var-annotated]
threespace_api/__init__.py:3527: error: Argument 1 to "dict" has incompatible type "map[List[object]]"; expected "Iterable[Tuple[, ]]"  [arg-type]
threespace_api/__init__.py:3527: error: Argument 1 to "map" has incompatible type "Callable[[Tuple[str, Tuple[int, int, Optional[str], int, Optional[str], int]]], List[object]]"; expected "Callable[[Tuple[str, Tuple[int, int, Optional[str], int, Optional[str], int]]], Tuple[Any, Any]]"  [arg-type]
threespace_api/__init__.py:3527: error: Incompatible return value type (got "List[object]", expected "Tuple[Any, Any]")  [return-value]
threespace_api/__init__.py:3612: error: Need type annotation for "reverse_command_dict" (hint: "reverse_command_dict: Dict[, ] = ...")  [var-annotated]
threespace_api/__init__.py:3612: error: Argument 1 to "dict" has incompatible type "map[List[object]]"; expected "Iterable[Tuple[, ]]"  [arg-type]
threespace_api/__init__.py:3612: error: Argument 1 to "map" has incompatible type "Callable[[Tuple[str, Tuple[int, int, Optional[str], int, Optional[str], int]]], List[object]]"; expected "Callable[[Tuple[str, Tuple[int, int, Optional[str], int, Optional[str], int]]], Tuple[Any, Any]]"  [arg-type]
threespace_api/__init__.py:3612: error: Incompatible return value type (got "List[object]", expected "Tuple[Any, Any]")  [return-value]
threespace_api/__init__.py:3690: error: Need type annotation for "reverse_command_dict" (hint: "reverse_command_dict: Dict[, ] = ...")  [var-annotated]
threespace_api/__init__.py:3690: error: Argument 1 to "dict" has incompatible type "map[List[object]]"; expected "Iterable[Tuple[, ]]"  [arg-type]
threespace_api/__init__.py:3690: error: Argument 1 to "map" has incompatible type "Callable[[Tuple[str, Tuple[int, int, Optional[str], int, Optional[str], int]]], List[object]]"; expected "Callable[[Tuple[str, Tuple[int, int, Optional[str], int, Optional[str], int]]], Tuple[Any, Any]]"  [arg-type]
threespace_api/__init__.py:3690: error: Incompatible return value type (got "List[object]", expected "Tuple[Any, Any]")  [return-value]
bomi/device_managers/yost_serial_comm.py:17: error: Skipping analyzing "serial": module is installed, but missing library stubs or py.typed marker  [import]
bomI/scope_widget.py:10: error: Skipping analyzing "pyqtgraph": module is installed, but missing library stubs or py.typed marker  [import]
bomI/scope_widget.py:11: error: Skipping analyzing "pyqtgraph.parametertree": module is installed, but missing library stubs or py.typed marker  [import]
bomI/scope_widget.py:15: error: Skipping analyzing "pyqtgraph.parametertree.parameterTypes": module is installed, but missing library stubs or py.typed marker  [import]
bomI/scope_widget.py:16: error: Skipping analyzing "pyqtgraph.parametertree.parameterTypes.basetypes": module is installed, but missing library stubs or py.typed marker  [import]
bomI/scope_widget.py:73: error: Incompatible default for argument "target_range" (default has type "None", argument has type "Tuple[float, float]")  [assignment]
bomI/scope_widget.py:73: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
bomI/scope_widget.py:73: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
bomI/scope_widget.py:74: error: Incompatible default for argument "base_range" (default has type "None", argument has type "Tuple[float, float]")  [assignment]
bomI/scope_widget.py:74: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
bomI/scope_widget.py:74: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
bomI/scope_widget.py:184: error: Incompatible default for argument "task_widget" (default has type "None", argument has type "TaskDisplay")  [assignment]
bomI/scope_widget.py:184: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
bomI/scope_widget.py:184: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
bomI/scope_widget.py:186: error: Incompatible default for argument "trigno_client" (default has type "None", argument has type "TrignoClient")  [assignment]
bomI/scope_widget.py:186: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
bomI/scope_widget.py:186: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
bomI/scope_widget.py:198: error: Incompatible types in assignment (expression has type "None", variable has type "TrignoClient")  [assignment]
bomI/scope_widget.py:500: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomI/scope_widget.py:503: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomI/scope_widget.py:603: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomI/scope_widget.py:660: error: Signature of "get" incompatible with supertype "Queue"  [override]
bomI/scope_widget.py:660: note:      Superclass:
bomI/scope_widget.py:660: note:          def get(self, block: bool = ..., timeout: Optional[float] = ...) -> Any
bomI/scope_widget.py:660: note:      Subclass:
bomI/scope_widget.py:660: note:          def get(self) -> None
bomI/device_managers/yost_serial_comm.py:17: error: Skipping analyzing "serial": module is installed, but missing library stubs or py.typed marker  [import]
bomI/device_managers/trigno_widget.py:13: error: Skipping analyzing "pyqtgraph": module is installed, but missing library stubs or py.typed marker  [import]
bomI/device_managers/trigno_widget.py:80: error: Need type annotation for "_layout"  [var-annotated]
bomI/device_managers/trigno_widget.py:111: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomI/device_managers/trigno_widget.py:125: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomI/device_managers/trigno_widget.py:126: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomI/device_managers/trigno_widget.py:276: error: Incompatible default for argument "trigno_client" (default has type "None", argument has type "TrignoClient")  [assignment]
bomI/device_managers/trigno_widget.py:276: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
bomI/device_managers/trigno_widget.py:276: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
bomI/device_managers/trigno_widget.py:361: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bomi/start_react_widget.py:127: error: Unsupported left operand type for | ("AlignmentFlag")  [operator]
bomi/start_react_widget.py:205: error: Name "pval" already defined on line 201  [no-redef]
bomi/device_managers/yost_manager.py:4: error: Skipping analyzing "serial": module is installed, but missing library stubs or py.typed marker  [import]
bomi/device_managers/yost_manager.py:40: error: Module has no attribute "getComPorts"  [attr-defined]
bomi/device_managers/yost_manager.py:55: error: Incompatible types in assignment (expression has type "TSDongle", variable has type "Optional[TSUSBSensor]")  [assignment]
bomi/device_managers/yost_manager.py:57: error: Incompatible types in assignment (expression has type "TSWLSensor", variable has type "Optional[TSUSBSensor]")  [assignment]
bomi/device_managers/yost_manager.py:59: error: Incompatible types in assignment (expression has type "TSEMSensor", variable has type "Optional[TSUSBSensor]")  [assignment]
bomi/device_managers/yost_manager.py:61: error: Incompatible types in assignment (expression has type "TSDLSensor", variable has type "Optional[TSUSBSensor]")  [assignment]
bomi/device_managers/yost_manager.py:63: error: Incompatible types in assignment (expression has type "TSBTSensor", variable has type "Optional[TSUSBSensor]")  [assignment]
bomi/device_managers/yost_manager.py:65: error: Incompatible types in assignment (expression has type "TSLXSensor", variable has type "Optional[TSUSBSensor]")  [assignment]
bomi/device_managers/yost_manager.py:67: error: Incompatible types in assignment (expression has type "TSNANOSensor", variable has type "Optional[TSUSBSensor]")  [assignment]
bomI/start_react_widget.py:127: error: Unsupported left operand type for | ("AlignmentFlag")  [operator]
bomI/start_react_widget.py:205: error: Name "pval" already defined on line 201  [no-redef]
bomI/device_managers/yost_manager.py:4: error: Skipping analyzing "serial": module is installed, but missing library stubs or py.typed marker  [import]
bomI/device_managers/yost_manager.py:40: error: Module has no attribute "getComPorts"  [attr-defined]
bomI/device_managers/yost_manager.py:55: error: Incompatible types in assignment (expression has type "TSDongle", variable has type "Optional[TSUSBSensor]")  [assignment]
bomI/device_managers/yost_manager.py:57: error: Incompatible types in assignment (expression has type "TSWLSensor", variable has type "Optional[TSUSBSensor]")  [assignment]
bomI/device_managers/yost_manager.py:59: error: Incompatible types in assignment (expression has type "TSEMSensor", variable has type "Optional[TSUSBSensor]")  [assignment]
bomI/device_managers/yost_manager.py:61: error: Incompatible types in assignment (expression has type "TSDLSensor", variable has type "Optional[TSUSBSensor]")  [assignment]
bomI/device_managers/yost_manager.py:63: error: Incompatible types in assignment (expression has type "TSBTSensor", variable has type "Optional[TSUSBSensor]")  [assignment]
bomI/device_managers/yost_manager.py:65: error: Incompatible types in assignment (expression has type "TSLXSensor", variable has type "Optional[TSUSBSensor]")  [assignment]
bomI/device_managers/yost_manager.py:67: error: Incompatible types in assignment (expression has type "TSNANOSensor", variable has type "Optional[TSUSBSensor]")  [assignment]
bomi/device_managers/yost_widget.py:6: error: Skipping analyzing "pyqtgraph": module is installed, but missing library stubs or py.typed marker  [import]
bomi/device_managers/yost_widget.py:44: error: Item "TSDongle" of "Union[TSDongle, _TSSensor]" has no attribute "device_type"  [union-attr]
bomi/device_managers/yost_widget.py:44: error: Item "_TSSensor" of "Union[TSDongle, _TSSensor]" has no attribute "device_type"  [union-attr]
bomi/device_managers/yost_widget.py:44: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)
bomI/device_managers/yost_widget.py:6: error: Skipping analyzing "pyqtgraph": module is installed, but missing library stubs or py.typed marker  [import]
bomI/device_managers/analog_streaming_client.py:2: error: Skipping analyzing "qtm": module is installed, but missing library stubs or py.typed marker  [import]
bomI/device_managers/analog_streaming_client.py:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 116 errors in 23 files (checked 23 source files)
kwsp commented 1 year ago

I love that you use types! Mypy doesn't handle third party libraries (e.g. pyqtgraph) unless you provide type stubs, hence I didn't adopt Mypy, and typed just enough to make me and Pylance happy. In general, I'd turn on ignore_missing_imports and just fix type bugs in our own code.

seasonedfish commented 1 year ago

Ah, gotcha!