Ensure backend creates sender callbacks with the correct controller#134
Ensure backend creates sender callbacks with the correct controller#134
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #134 +/- ##
==========================================
+ Coverage 90.52% 90.56% +0.04%
==========================================
Files 41 41
Lines 1920 1930 +10
==========================================
+ Hits 1738 1748 +10
Misses 182 182 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I agree. I think that if a controller is necessary for the |
Feel free to cherry pick this. I remember having this problem in ophyd-async too, I'm looking through pytango issues now. EditI was thinking of a Main still passes, so this failure is probably a consequence of the new test added here. |
evvaaaa
left a comment
There was a problem hiding this comment.
GTM once CI is passing...
|
|
There was a problem hiding this comment.
Something like
def _get_scan_coros(
root_controller_api: ControllerAPI, root_controller: Controller
) -> list[Callable]:
scan_dict: dict[float, list[Callable]] = defaultdict(list)
for controller_api in root_controller_api.walk_api():
controller = root_controller.get_controller_by_path(controller_api.path)
_add_scan_method_tasks(scan_dict, controller_api)
_add_attribute_updater_tasks(scan_dict, controller_api, controller)
scan_coros = _get_periodic_scan_coros(scan_dict)
return scan_coros
|
Closing in preference for #135 |
Fixes #130
This is not the ideal fix, but tried many different things and they were all quite horrible:
ControllerAPI- the transport should not have access to itScanCallbacks toControllerAPI- this just doesn't really make sense, only the Backend needs themBackendmanually parse methods and attribute out of theControllerand only create theControllerAPIat the end - this was OK, but meant repeating this code multiple times.I think the interface of the handlers may not be correct, which is making this painful. It doesn't seem necessary for the whole controller to be passed into the handler put/update methods.
I don't know why that tango test is suddenly failing on 3.12 😢 It doesn't happen on main or locally.