Skip to content

Commit

Permalink
DOC: Hint Optional[ophyd.Signal] and move to init
Browse files Browse the repository at this point in the history
  • Loading branch information
tangkong committed Oct 19, 2023
1 parent 6831864 commit 5d1999b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions atef/procedure.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ class Target:
def to_signal(
self,
signal_cache: Optional[_SignalCache] = None
) -> Optional[ophyd.EpicsSignal]:
) -> Optional[ophyd.Signal]:
"""
Return the signal described by this Target. First attempts to use the
device + attr information to look up the signal in happi, falling back
to the raw PV.
Returns
-------
ophyd.EpicsSignal
ophyd.Signal
the signal described by this Target
"""
try:
Expand Down
6 changes: 3 additions & 3 deletions atef/widgets/config/data_active.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import typhos
import typhos.cli
import typhos.display
from ophyd.signal import EpicsSignalBase
from ophyd.signal import Signal
from qtpy import QtCore, QtGui, QtWidgets
from qtpy.QtCore import Qt
from qtpy.QtWidgets import QDialogButtonBox
Expand Down Expand Up @@ -901,7 +901,7 @@ def __init__(self, data: Optional[ValueToTarget] = None, **kwargs):
self.edit_widget = None
if data is None:
data = ValueToTarget()
self._sig = None
self._sig: Optional[Signal] = None
self._curr_value = None
self._dtype = None
self._enum_strs = None
Expand Down Expand Up @@ -960,7 +960,7 @@ def update_input_placeholder(self) -> None:
Updates value input widget with a QLineEdit with the approriate validator
given the target's datatype
"""
self._sig: EpicsSignalBase = self.data.to_signal()
self._sig = self.data.to_signal()
if self._sig is None:
self.edit_widget = QtWidgets.QLabel('(no target set)')
insert_widget(self.edit_widget, self.value_input_placeholder)
Expand Down

0 comments on commit 5d1999b

Please sign in to comment.