-
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 dimensions in NXdata to be lists of strings #1246
Conversation
Anyone know how to fix the warning that's being generated? :) |
It's a new data type included in the PR. |
Which slice of data to show in a plot by default. This is useful especially for datasets with more than 2 dimensions.
Hi all, I had a meeting today about this PR and we have some changes (thanks @graeme-winter, @yayahjb, @soph-dec, and @kalcutter). First, for 2D images, we note that if the data has the dimensions listed below, then existing general case NeXus readers/plotters should work:
Note the number of dimensions above: 2, 3, 3, and 4. Distinguishing between the two degenerate cases is done by the presence of the NXdetector_module class, which has the fields OK! So here are the four new use-cases that are not compatible with existing general-case plot making tools:
With the number of dimensions 3,4,4,5. Now we have another layer of degeneracy and no way to know how to plot the 2D image. So the new proposal is to add an attribute In the below example, we combine both using strings as array indices and default_slice:
So, what do folks think of this alternative? Note to @mkoennecke, some feedback we received during this meeting was that since the proposed use case of multi-channel data already breaks existing viewers, there's no harm in extending the data type of |
Any comments on this PR? Including Also, I'm afraid I don't know enough about the build system to fix the current build error. Can someone lend a hand? Thanks! |
(updated above comment to indicate it's the data type of |
Adding |
Co-authored-by: Sophie Hotz [email protected]
Co-authored-by: soph-dec <[email protected]>
Thanks @soph-dec! Checks now pass. |
Co-authored-by: Sophie Hotz <[email protected]> Co-authored-by: soph-dec <[email protected]>
Is this correct?
Isn't the idea to always have integers but saved as NX_CHAR because we need to support Edit: maybe we should use -1 instead of "." so |
@woutdenolf I've added the type |
Ok thanks for the clarification. So basically
|
Yup, that's my understanding. Thanks! |
Fix conflicts, adjusting phrase "Most dimensions scales will be sequences of numbers" to "Most AXISNAME fields will be sequences of numbers"
Conflicts fixed, mostly trivial, with one re-word. @woutdenolf can you re-check this? Thanks! |
This PR is ready for a NIAC vote. Please vote with an emoji on this comment. Options include thumbs up for yes, thumbs down for no, and anything else to abstain. Thank you. Voting will close in two weeks. |
Sorry, at the risk of exposing my ignorance, I have a few questions.
This statement seems somewhat ambiguous to me. Does the "should" refer to an expectation that What does the word "should" actually mean? Are we following RFC 2119 semantics, or is this meant as a more emphatic statement?
Given
What are the processing expectations if AXISNAME is an array of NX_CHAR that contains an element What are the processing expectations if AXISNAME is an array of NX_CHAR, the first element is What are the processing expectations if AXISNAME is an array of NX_CHAR with two elements having the same value and that value is specified in |
Thank you @paulmillar! Note that at this point in we are in the middle of a vote so it is too late to make changes to this PR, otherwise it would be unfair to those that have already voted. That has been the protocol at live NIAC meetings, where once a vote has been called for and seconded it has to finish. I don't see why it wouldn't be the case for an online vote as well. Indeed this PR has already been discussed and reviewed so I think that's fair. THAT SAID, your questions are good, and I think you've identified one change I would have made in this PR. However, I think the change is clarification, and not substance, so I think it would be fine as a separate PR that doesn't need a vote. More below.
Should is a requirement. I had never seen RFC 2119 before, thanks for pointing it out! Just to check, I reviewed NXmx to find usages of the word "should" and found 10. Each could equally be considered ambiguous based on RFC 2119. I'd prefer a separate review of the usage of imperatives outside of this PR.
Yes to your specific example, a single value if the data has only one dimension. My understanding of NeXus is that this doesn't generally need to be specified, but I could be wrong here.
No. See "should" above.
This is a good question. The second example lists
"." in
Order of operations states that "2" will be searched for in
This is undefined. I really appreciate these comments. Of these, I'd like to add "order of operations" to For the rest, I think we have to be careful to avoid overdefining terms. I don't think we need to add these clarifications to the NXdata spec unless someone asks for them. Do you agree? |
Since "2" is not a valid name for a group or field, that logic could be included and the search for such an HDF5 address avoided. |
Same for ".". |
Ah good stuff @prjemian. Thanks. |
Vote has passed, thanks all. |
@paulmillar I believe @prjemian answered your questions best when he pointed out that "2" and "." are not legal |
Two changes here:
With this change, part of the channel use case proposed by @soph-dec in #940 can be supported. Quoting the documentation for the current FileWriter2 proposal by Dectris with slight modification (the dimensions of
data
) as an example:Where
nP
is the number of images andnC
is the number of channels. Normally thechannel
field, akaAXISNAME
, could only be of type NX_NUMBER, similar to theimage_id
field, but a set of English names is preferred to identify the channels.Note, while the change in AXISNAME was approved by vote in nexusformat/NIAC#97, I do not know what effect this has on existing plotting software. For example the DIALS image viewer would need to know what channel to display by default. Also, this could affect the implementation of plot viewing in NeXpy.
We have a Telco tomorrow, so I hope we can discuss those issues then.
Closes #945 and nexusformat/NIAC#97. Partially addresses #940.