Skip to content

Conversation

@woutdenolf
Copy link
Contributor

No description provided.

Comment on lines 78 to 83
* 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.
Copy link
Contributor Author

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)

Copy link
Contributor Author

@woutdenolf woutdenolf Mar 12, 2025

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"

Comment on lines +145 to +146
: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.
Copy link
Contributor Author

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)

Copy link
Contributor Author

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].

Copy link
Contributor

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].

Copy link
Contributor Author

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.

Comment on lines +145 to +146
: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.
Copy link
Contributor

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].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NXdata: stricter suggestion on when AXISNAME_indices can be omitted

3 participants