-
Notifications
You must be signed in to change notification settings - Fork 5
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 enumerated types #92
Conversation
@coretl @GDYendell interested in your comments on this particularly should the enums be listed via a DICT or LIST? The former allows us to name the values for context - but is only useful when looking in the support YAML file. |
I vote list, with values that are strings. I think inventing names for the enum keys will take us too far back in builder directions... |
@coretl |
OK I have made it so that
e.g. - type: enum
name: clock_rate
description: |
demonstrates use of VME clock rates as an enum
this is an example of an 'illegal' python enum
values:
1Hz: 0
2Hz: 1
5Hz: 2
10Hz: 3
dummy: supplying 1Hz in IOC YAML will render the arg as 0 only options allowed in schema for clock_rate are [1Hz, 2Hz, 5Hz, 10Hz, dummy] |
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## main #92 +/- ##
==========================================
+ Coverage 96.22% 96.64% +0.42%
==========================================
Files 9 9
Lines 371 388 +17
==========================================
+ Hits 357 375 +18
+ Misses 14 13 -1
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@coretl @GDYendell we are going to end up with repetition here. Every support module that needs to supply clock rate to VME would need this enum described. Is that an issue? -- edit -- its worse than that. Every Entity that needs clock_rate would re-describe the enum. |
This allows us to add enumerated types as follows:
and then use them like this in and IOC YAML:
JSON schema will validate the type as well as values for those enums containing only one type.
The use of DICT gives each value a name that can give context to a developer who is reading the SUPPORT YAML but those names are not exposed when editing the IOC YAML.
THEREFORE: we could instead just have a list of values.