Mantid's interpretation of the NeXus format uses multiple root-level "NX_class: NXentry" groups to store multiple workspaces in a single NeXus HDF5 file. By using additional root-level groups, such as "NX_class: NXcollection", metadata about a group of workspaces may be stored. In addition, the NeXus format itself allows other, non-NeXus information to be stored in an HDF5 file, provided it avoids collisions with the NeXus naming system. In combination, all of this led to the requirement solved by the current PR, which allows LoadNexusProcessed to function correctly in the presence of other root-level non-NXentry and non-NeXus groups.
Summary of work
This commit includes the following changes:
When LoadNexusProcessed is determining the number of workspaces in a NeXus HDF5 file, it now counts the number of root-level "NX_class: NXentry" groups. Previously, it counted the number of root-level groups, assuming all were of "NX_class: NXentry".
A new unit test has been added to test these changes: LoadNexusProcessedTest::test_load_workspace_group_other_root_groups.
In order to verify these changes "by hand" it's recommended to take a look at the contents of the test-input file: build/ExternalData/Testing/Data/UnitTest/WorkspaceGroup_other_groups.nxs using the h5dump tool. In addition to including twelve workspaces (, as NX_class: NXentry "mantid_workspace_nn" groups), this file adds a root-level NX_class: NXcollection "metadata" group, and another root-level non-NeXus group. Following the form of the new unit test, verify that LoadNexusProcessed loads this file as a group workspace, and successfully ignores the other root-level groups in the file.
Reviewer
Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.
Do changes function as described? Add comments below that describe the tests performed?
Do the changes handle unexpected situations, e.g. bad input?
Has the relevant (user and developer) documentation been added/updated?
Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.
Gatekeeper
If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.
From 'main' PR#38324
Description of work
Mantid's interpretation of the NeXus format uses multiple root-level "NX_class: NXentry" groups to store multiple workspaces in a single NeXus HDF5 file. By using additional root-level groups, such as "NX_class: NXcollection", metadata about a group of workspaces may be stored. In addition, the NeXus format itself allows other, non-NeXus information to be stored in an HDF5 file, provided it avoids collisions with the NeXus naming system. In combination, all of this led to the requirement solved by the current PR, which allows
LoadNexusProcessed
to function correctly in the presence of other root-level non-NXentry and non-NeXus groups.Summary of work
This commit includes the following changes:
LoadNexusProcessed
is determining the number of workspaces in a NeXus HDF5 file, it now counts the number of root-level "NX_class: NXentry" groups. Previously, it counted the number of root-level groups, assuming all were of "NX_class: NXentry".EWM ref:
EWM#7148
To test:
A new unit test has been added to test these changes:
LoadNexusProcessedTest::test_load_workspace_group_other_root_groups
.In order to verify these changes "by hand" it's recommended to take a look at the contents of the test-input file:
build/ExternalData/Testing/Data/UnitTest/WorkspaceGroup_other_groups.nxs
using theh5dump
tool. In addition to including twelve workspaces (, asNX_class: NXentry
"mantid_workspace_nn" groups), this file adds a root-levelNX_class: NXcollection
"metadata" group, and another root-level non-NeXus group. Following the form of the new unit test, verify thatLoadNexusProcessed
loads this file as a group workspace, and successfully ignores the other root-level groups in the file.Reviewer
Please comment on the points listed below (full description). Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.
Code Review
Functional Tests
Does everything look good? Mark the review as Approve. A member of
@mantidproject/gatekeepers
will take care of it.Gatekeeper
If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.