-
Notifications
You must be signed in to change notification settings - Fork 65
nxdata stricter suggestion on when axisname indices can be omitted + clarify 3D or higher #1550
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
base: main
Are you sure you want to change the base?
nxdata stricter suggestion on when axisname indices can be omitted + clarify 3D or higher #1550
Conversation
base_classes/NXdata.nxdl.xml
Outdated
| * Histogram data. For example ``x`` has one more value than ``data``. | ||
| * Alternative axes. For example instead of a single ``x`` axis you can have several axes, one of which being the default. | ||
| * Signals with more than one dimension. For example ``data`` could be 2D with axes ``x`` and ``y`` along each dimension. | ||
| Equivalently 3- or higher-dimensional data is allowed. | ||
| * Axes with more than one dimension. For example ``data`` could be 2D with axes ``x`` and ``y`` also being 2D, providing a | ||
| unique ``(x, y)`` coordinate for each ``data`` point. Equivalently 3- or higher-dimensional axes are allowed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addresses @rayosborn comment #1396 (review)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference: the examples could give the impression NXdata only support 1D and 2D data.
Solved by
- Clearly prepend with "For example"
- Add "Equivalently 3- or higher-dimensional data is allowed" and "Equivalently 3- or higher-dimensional axes are allowed"
| :ref:`axes </NXdata@axes-attribute>` attribute and :ref:`AXISNAME </NXdata/AXISNAME-field>` is one-dimensional, | ||
| the :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` attribute can be omitted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addresses @PeterC-DLS comment #1396 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference: for higher dimensional axes the AXISNAME_indices attribute can never be omitted unambiguously by using the indices in @axes instead. For example @axes=["x", "x", "z"] could be @x_indices=[0,1] or @x_indices=[1,0].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a bit too strong as you could determine the indices ordering from the signal field shape if the pertinent dimensions are distinct: in the example, signal[23,47,17] with x[47,23] is unambigously inferred to have @x_indices=[1,0].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure it can be omitted for nD if it can be derived "unambigously". But then to define what "unambigously" means in this context would be rather convoluted. For example it won't work when signal[23,23,17].
So your original suggestion to omit AXISNAME_indices only for 1D still makes sense imo.
| :ref:`axes </NXdata@axes-attribute>` attribute and :ref:`AXISNAME </NXdata/AXISNAME-field>` is one-dimensional, | ||
| the :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` attribute can be omitted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a bit too strong as you could determine the indices ordering from the signal field shape if the pertinent dimensions are distinct: in the example, signal[23,47,17] with x[47,23] is unambigously inferred to have @x_indices=[1,0].
No description provided.