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

Support enum signals for enum classes that are generated at runtime #239

Closed
DiamondJoseph opened this issue Apr 18, 2024 · 3 comments · Fixed by #341
Closed

Support enum signals for enum classes that are generated at runtime #239

DiamondJoseph opened this issue Apr 18, 2024 · 3 comments · Fixed by #341
Assignees
Labels
bug Something isn't working enhancement New feature or request hackathon Good issues for the upcoming bluesky hackathon i22

Comments

@DiamondJoseph
Copy link
Contributor

As part of instantiating (e.g. a PandaA) from its PVI tree, we have a series of enumeration signals for which we do not know the possible values they can take. We should be able to instantiate those signals, and access a generated Enum class which allows iterating through all of the possible choices that that underlying PV supports. This type is not available for static type checking.

@DiamondJoseph DiamondJoseph added bug Something isn't working enhancement New feature or request i22 hackathon Good issues for the upcoming bluesky hackathon labels Apr 18, 2024
@coretl
Copy link
Collaborator

coretl commented May 8, 2024

Should use the Literal syntax defined in #249 (comment)

@DiamondJoseph
Copy link
Contributor Author

Isn't the Literal syntax for #238 and this is GeneratedChoice?

@coretl
Copy link
Collaborator

coretl commented May 15, 2024

Isn't the Literal syntax for #238 and this is GeneratedChoice?

Yes, you're right. However I think we should drop GeneratedChoices as it's not pickleable, and instead treat these as str datatype, but put choices in the output of get_descriptor. This is still introspectable enough for us, while still being a simple datatype to pass around and serialize, and looks a lot like the output of #238

@evalott100 evalott100 self-assigned this May 23, 2024
@evalott100 evalott100 linked a pull request May 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request hackathon Good issues for the upcoming bluesky hackathon i22
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants