-
Notifications
You must be signed in to change notification settings - Fork 56
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
Allow for open enumerations #1521
base: main
Are you sure you want to change the base?
Conversation
There are a few places we want to consider open enumerations. #1486 adds Also in both locations, I think just adding |
1952b31
to
ea0c66f
Compare
I brought in the changes from #1486 now and already make the enum for the identifier type open (with the possibility of reverting if #1486 yields a different outcome what was is proposed there) Afterwards, I went digging a bit for possible other uses of open enumerations within existing base classes / application definitions, using this search in the GitHub GUI repo:nexusformat/definitions enumeration (path:/^applications\// OR path:/^base_classes\//) resulting in these search results. Here is a list of concepts where it might make sense to reconsider if the provided values are complete. I also added a bit of reasoning why this might be a good place for an open enumeration:
I think we could do 1 and 2 together with this PR and then subsequent changes to make other enumerations open in separate PRs. What do you think?
I agree that would be helpful. Do you want to do this in the XML definitions themselves or just in the HTML rendering? Currently, I only modified the HTML, so if you look at the XML, you would only see the attribute |
The idea of this PR is to allow for open enumerations, i.e., to allow values not explicitly given in the enumeration 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 by default enumerations will be closed 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.
NXsource/type
which is now an open enum:Note that for some reason, the changes to the nxdl.xsd did not show up in my local build (would be innxdl_desc.html#enumerationtype
), so maybe this implementation is not yet correct. I could appreciate someone with more knowdledge of the NXDl language to chime in. This is also why this is currently still a draft.EDIT: The changes to the nxdl.xsd are now also showing up in the HTML description of the NXDL:
Closes #1520