Skip to content

Commit 991db06

Browse files
authored
Merge pull request #36 from ISISComputingGroup/Ticket8553_pyright_day_ca_channel_wrapper
Ticket8553 pyright day ca channel wrapper
2 parents c065eb8 + b417a08 commit 991db06

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ reportUnnecessaryIsInstance = true
118118
reportUntypedBaseClass = true
119119
reportUntypedClassDecorator = true
120120
reportUntypedFunctionDecorator = true
121+
stubPath = "src/genie_python/typings"
121122

122123
[tool.setuptools_scm]
123124
version_file = "src/genie_python/_version.py"

src/genie_python/genie_cachannel_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ def check_for_enum_value(value: "PVValue", chan: CaChannel, name: str) -> "PVVal
435435
@staticmethod
436436
def add_monitor(
437437
name: str,
438-
call_back_function: "Callable[[PVValue, str, str], None]",
438+
call_back_function: "Callable[[PVValue, Optional[str], Optional[str]], None]",
439439
link_alarm_on_disconnect: bool = True,
440440
to_string: bool = False,
441441
use_numpy: bool | None = None,
@@ -477,8 +477,8 @@ def _process_call_back(epics_args: dict[str, str], _: dict[str, str]) -> None:
477477
value = waveform_to_string(value)
478478
else:
479479
value = str(value)
480-
481480
chan.last_value = value
481+
482482
call_back_function(
483483
value,
484484
epics_args.get("pv_severity", AlarmSeverity.No),

src/genie_python/genie_p4p_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def pv_exists(name: str, timeout: float) -> bool:
124124
@staticmethod
125125
def add_monitor(
126126
name: str,
127-
call_back_function: "Callable[[PVValue, str, str], None]",
127+
call_back_function: "Callable[[PVValue, Optional[str], Optional[str]], None]",
128128
link_alarm_on_disconnect: bool = True,
129129
to_string: bool = False,
130130
use_numpy: Optional[bool] = None,

src/genie_python/genie_pv_connection_protocol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from collections.abc import Callable
2-
from typing import TYPE_CHECKING, Protocol, Tuple, runtime_checkable
2+
from typing import TYPE_CHECKING, Optional, Protocol, Tuple, runtime_checkable
33

44
if TYPE_CHECKING:
55
from genie_python.genie import PVValue
@@ -29,7 +29,7 @@ def pv_exists(name: str, timeout: float) -> bool: ...
2929
@staticmethod
3030
def add_monitor(
3131
name: str,
32-
call_back_function: "Callable[[PVValue, str, str], None]",
32+
call_back_function: "Callable[[PVValue, Optional[str], Optional[str]], None]",
3333
link_alarm_on_disconnect: bool = True,
3434
to_string: bool = False,
3535
use_numpy: bool | None = None,

0 commit comments

Comments
 (0)