mantidproject / mantid

Main repository for Mantid code
https://www.mantidproject.org
GNU General Public License v3.0
211 stars 124 forks source link

LoadNexusProcessed: root-level NXentry groups #38371

Closed ekapadi closed 3 weeks ago

ekapadi commented 3 weeks ago

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:

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

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.