-
Notifications
You must be signed in to change notification settings - Fork 4
Implement SubControllerVector #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #192 +/- ##
==========================================
- Coverage 92.20% 91.95% -0.26%
==========================================
Files 40 40
Lines 2065 2112 +47
==========================================
+ Hits 1904 1942 +38
- Misses 161 170 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
): | ||
if isinstance(sub_controller, SubControllerVector): | ||
for index, child in sub_controller.children(): | ||
child.__sub_controller_vector = name # noqa: SLF001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to find an alternative to this
Maybe it makes more sense to have @dataclass(frozen=True)
class VectorOrigin:
name: str
vector: weakref.ReferenceType[SubControllerVector] Then, we can dereference the parent vector if we want to do something with knowledge of what controllers are in a group, but also just pass the name to pvi since that is all we need for grouping. I'm unsure of any use cases the vector class has other than pvi grouping though, so I'm not sure is this adds any value. |
@shihab-dls I think the trouble of having to keep track of what vector a sub controller is part of would be avoided if Then with a controller hierarchy like
the path would be ["fp", 1, "hdf"] where integers in the path are treated specially:
If this works as I would like, the FP controller vector itself could have attributes and commands. For example here There may be complications with as this, but that is how it looks in my head. Does that make some sense? Happy to pair on this and figure out the details. |
I like this idea (adopting more from ophyds |
fixes #122
This PR introduces a
SubControllerVector
, which is a mapping ofint
toSubController
, used in pvi grouping.