Skip to content
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

Add child protocol #1601

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add child protocol #1601

wants to merge 3 commits into from

Conversation

rosesyrett
Copy link
Contributor

It has become useful in ophyd.v2 to add a children property to devices.

To remain consistent with the parent property, it was suggested that adding a protocol like HasChildren, analogous to HasParent, would be useful

Description

A PR has been started about this for ophyd.v2. See here: bluesky/ophyd#1138

How Has This Been Tested?

I am unsure how protocols are tested, please advise and I will add tests.

@rosesyrett
Copy link
Contributor Author

not sure why lint is failing, seems to be complaining about something my changes have not altered.

@untzag
Copy link
Member

untzag commented Aug 1, 2023

@RAYemelyanova consider adding some tests

bluesky/tests/test_protocols.py

Also can this be an @property so that instance attributes are valid?

@untzag
Copy link
Member

untzag commented Aug 1, 2023

For what it's worth this isn't the implementation I happened to go with for yaqc-bluesky, I just have a list of child objects. I don't know how important the concept of a device name is to bluesky, so I don't really know why we want tuples of (name, device).

That said I'm all for standards and my devices do have names so I'd be happy to change yaqc-bluesky to match this protocol once merged.

We could look at e.g. instrbuilder to see about other implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants