You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Config error: output references must be of the form <id>.side_outputs.<name>"
)
ifmethodisNone:
raiseValueError(f"could not find method referenced by {ref_id} in {v}")
Pyright complains about the body of the second if statement, saying the following:
Type analysis indicates code is unreachable
This is understandable, because the type of method in the function signature is MethodWrapper, and so should never be None. Thus, the condition in the if statement will never evaluate to True, and the body will never be executed.
One way to easily fix this is by making method have type Optional[MethodWrapper]. However, some investigation into whether it should ever be None (and possibly investigation in further refactorings in other logic in the UI layer) may be wise before opting for the simplest fix.
The text was updated successfully, but these errors were encountered:
yousefmoazzam
changed the title
Fix incorrect type-hint in UI layer's check_valid_ref_id() function
Incorrect type-hint in UI layer's check_valid_ref_id() function
Oct 10, 2024
The function is the following:
httomo/httomo/ui_layer.py
Lines 241 to 263 in 7842bae
Pyright complains about the body of the second
if
statement, saying the following:This is understandable, because the type of
method
in the function signature isMethodWrapper
, and so should never beNone
. Thus, the condition in theif
statement will never evaluate toTrue
, and the body will never be executed.One way to easily fix this is by making
method
have typeOptional[MethodWrapper]
. However, some investigation into whether it should ever beNone
(and possibly investigation in further refactorings in other logic in the UI layer) may be wise before opting for the simplest fix.The text was updated successfully, but these errors were encountered: