-
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
Remove-NXroot-inheritance #1505
base: main
Are you sure you want to change the base?
Conversation
When group classes that are valid in any base class are added to the NXobject base class, it is important to exclude NXroot to enforce the rule that only NXentry groups are permitted.
This is an anomalous entry that is the only example in the entire repository where the mechanism for defining classes is conflated with the contents of that class. Its presence here implies that the attribute is required, whereas it is completely redundant.
This |
I am 👍🏻 on removing the inheritance from |
There is already an extended discussion of the |
I think it makes lots of sense for the top-level group of an hdf5 file to declare itself to be the root of a nexus file (rather than inferring that it is because there is 1 or more groups tagged with Looking ahead (and as I as trying to say in the call / comments today), it would be nice to blur the "top of a nexus file" and "top of an hdf5 file" a bit. The
should not be allowed (I understand that it currently is not allowed but do not understand why it is not allowed). A concrete use case I have for this is an experiment we are doing at NSLS-II where we put identical samples on an pdf beamline and a xafs beamline and coordinate data collection between them. It seems reasonable to have one (on-disk) file with all of the data for the experiment from both beamlines consolidated in it and to leverage the fact that hdf5 lets you do nested groups to provide a bit of additional structure. I presume most tools can handle multiple on-disk files at a time, so it seems to be a direct extension to support "multiple nexus files in one hdf5 file" as well. e.g. nexpy will show you the contents of multiple hdf5 files in a nice tree. It would also give a nice path to mix nexus and not-nexus in the same hdf5 file
If we want to be able to serialize nexus into zarr, tiled, or any other format that has a different set of boundaries between what is "file system" structure and what is "in-file" structure having an explicit marker that "this is the top of the nexus tree" is extremely useful. To the question about validators, it seems like the solution is that Sandor "just" needs to add a |
This is not correct. The NeXus standard does not control the root of the HDF5 file. The HDF5 file root should not be validated other than for: [1] at least one NXentry group, [2] the presence of the It is perfectly acceptable (not a warning or an error) to have non-NeXus content at the file root, as long as such content does not use For example, a tree such as this, with mixed NeXus and non-NeXus content, should not fail NeXus validation:
|
The NXroot base class is unique in not applying to an HDF5 group, but to the root level of the NeXus file itself.
base_classes/NXroot.nxdl.xml
Outdated
In the NeXus standard, only NXentry groups are allowed at the root | ||
level of a file, although it is permitted to include additional groups | ||
that are not part of the NeXus tree and will not be validated by | ||
NeXus tools. NeXus defines a number of file-level attributes that can | ||
be used to annotate the file. |
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.
In the NeXus standard, only NXentry groups are allowed at the root | |
level of a file, although it is permitted to include additional groups | |
that are not part of the NeXus tree and will not be validated by | |
NeXus tools. NeXus defines a number of file-level attributes that can | |
be used to annotate the file. | |
In the NeXus standard, only NXentry groups are allowed at the root | |
level of a file, although it is permitted to include additional groups | |
that are not part of the NeXus tree and will not be validated by | |
NeXus tools. NeXus defines a number of root-level attributes that can | |
be used to annotate the root group. |
additional groups and datasets
…On Wed, Nov 6, 2024, 7:59 PM Thomas A Caswell ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In base_classes/NXroot.nxdl.xml
<#1505 (comment)>
:
> + In the NeXus standard, only NXentry groups are allowed at the root
+ level of a file, although it is permitted to include additional groups
+ that are not part of the NeXus tree and will not be validated by
+ NeXus tools. NeXus defines a number of file-level attributes that can
+ be used to annotate the file.
⬇️ Suggested change
- In the NeXus standard, only NXentry groups are allowed at the root
- level of a file, although it is permitted to include additional groups
- that are not part of the NeXus tree and will not be validated by
- NeXus tools. NeXus defines a number of file-level attributes that can
- be used to annotate the file.
+ In the NeXus standard, only NXentry groups are allowed at the root
+ level of a file, although it is permitted to include additional groups
+ that are not part of the NeXus tree and will not be validated by
+ NeXus tools. NeXus defines a number of root-level attributes that can
+ be used to annotate the root group.
—
Reply to this email directly, view it on GitHub
<#1505 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARMUMF6XNG63NSHPLBBFVDZ7LCRPAVCNFSM6AAAAABRFEPWXOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDIMJZG44DQNRTGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This also adds fields to the permitted non-NeXus objects at the root level.
@tacaswell, I made another commit that partly implements what you suggest, although I still wanted to avoid use of "root group" since I think that contributed to the original confusion about the need for assigning the |
This PR addresses Issues #1493 and #1494. It contains two changes to the NXroot NXDL file,
NX_class
attribute definition from root attributes. This is the only example in the entire repository where the mechanism for defining classes is conflated with the contents of that class. Its presence here implies that the attribute is required, whereas it is completely redundant.