-
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
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 |
b464848
to
5a7fecb
Compare
542f065
to
b975817
Compare
c38117b
to
4d7ecf7
Compare
4 possible routes:
Straw poll in Telco: 3: 10 votes, 1: 3 votes, 4: 1 vote. @lukaspie if you could implement 3 here, then we'll vote on this PR.
Plus the corresponding change to nxdl.xsd. Note if open=False, custom must = False |
Co-authored-by: Aaron S. Brewster <[email protected]>
4d7ecf7
to
6b70ea4
Compare
…not yet merged
Hi all, as discussed in the Telco, we can now move this PR to an online vote. NIAC committee members please vote on this PR using emojis on this comment. 👍 for yes, 👎 for no, anything else (for example 👀) to abstain. We need 14 votes to hit quorum so please review and vote! |
I was wondering whether NIAC should have an opinion on introducing new terms as specialisation of existing terms. Here is a made-up example. Suppose, a particular NeXus file could be described using an NXsource/type with value "Pulsed Muon Source"; however, for this file, the source could be more accurately described as a "Ultra-fast Pulsed Muon Source". There may be some distinction between the more general term ("Pulsed Muon Source") and the more specific term ("Ultra-fast Pulsed Muon Source"). There could be some benefits from describing the file using the more precise term. The open enumeration would allow someone simply to use the more precise term ("Ultra-fast Pulsed Muon Source"). However, introducing a new term also has some negative aspects:
Introducing a new term as a specialisation ("Ultra-fast Pulsed Muon Source" vs "Pulsed Muon Source") allows for more accurate description, but introduces complexity. This creates a tension. The decision on whether (on balance) it is "better" to use an existing, broader term or introduce a newer, narrower term is non-trivial. Given this is an open enumeration, the person introducing the new term (i.e., anyone writing a NeXus file) might not being aware of the consequences of their actions. This is a place where NIAC could offer advice; e.g., through the documentation. For example, the documentation could say something to the effect:
If we want, we could put in something stronger.
|
Another thought: do we want to request that new values for open enumerations are reported back to NIAC? With this information, we could add the new value(s) to the list in an updated version of NeXus. Doing this would reduce the risk of multiple incompatible values being selected by different facilities. Alternatively, we could hold a list of enumeration values in lists outside of NeXus standard. This could allow for a faster process through which new values become visible to everyone. |
@paulmillar thanks for your comments, but they make it unclear as to what is happening in this PR right now. This PR is under review and in a voting period. Do you want your comments to imply that this PR needs changes? I assume not because you voted in favor of the proposal. If not, can you move your comments to a new issue? Again, I want to emphasize my appreciation of your review and your comments. It's great to get scrutiny and feedback. |
@phyy-nx , My comments are intended to describe ways in which (I think) the proposed changes could be improved. These are topics that (I think) NIAC should discuss. However, they are not intended to block this PR. Instead, they may be addressed after the PR is accepted. The idea of creating issues on these comments sounds good to me. However, I propose only doing that once the PR is accepted. (Open an issue against something that isn't yet in the repo seems a little odd.) Would that be OK? |
No worries. The online voting method is new to the NIAC. It's totally fine if you'd like to do a issue after the PR is accepted. Thanks! |
The vote has passed. Thanks all. @lukaspie please merge at your convenience. @paulmillar please be sure any issues you raised that you'd like to pursue are moved to a new issue. Thanks. |
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