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

Open enumerations #1520

Open
2 of 3 tasks
lukaspie opened this issue Dec 10, 2024 · 0 comments · May be fixed by #1521
Open
2 of 3 tasks

Open enumerations #1520

lukaspie opened this issue Dec 10, 2024 · 0 comments · May be fixed by #1521
Labels
enhancement NIAC has requested The NIAC has requested this issue to be considered

Comments

@lukaspie
Copy link
Contributor

lukaspie commented Dec 10, 2024

Spinning off from #1407 (comment), the idea is to allow for open enumerations, i.e., enumeration to allow values not explicitly given in the list. An example is the type field in NXsource (https://manual.nexusformat.org/classes/base_classes/NXsource.html#nxsource-type-field) which is too restrictive for some experiments.

Note that open enumeration should not be the default as for some fields/attributes, the values given in the enumerations really are the only sensible ones (a prominent example being NXentry/definition field in most application definitions.

Tasks:

  • Create a new PR that adds to enumeration an attribute open=False, which would allow the enumeration to allow values not in the list.
  • Adapt sphinx to render it nicely (it should be possible to see from the html if the enumeration is open or closed). Could potentially be done in the same PR.
  • Check implications for validators. They should not produce errors but could produce a warning.
@lukaspie lukaspie added enhancement NIAC has requested The NIAC has requested this issue to be considered implementation labels Dec 10, 2024
@lukaspie lukaspie linked a pull request Dec 10, 2024 that will close this issue
2 tasks
@lukaspie lukaspie linked a pull request Dec 10, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement NIAC has requested The NIAC has requested this issue to be considered
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant