Skip to content

Conversation

@rboston628
Copy link
Contributor

@rboston628 rboston628 commented Jan 7, 2026

Description of work

In PR #40570, a new file descriptor, NexusDescriptorLazy, was created for shallow and lazy checking of files as part of the Load algorithm's confidence check. There, only a few algorithms were migrated over.

In this PR, we migrate over the following to use the new file descriptor:

  • LoadEMU.h
  • LoadILLDiffraction.h
  • LoadILLIndirect2.h
  • LoadILLLagrange.h
  • LoadILLPolarizedDiffraction.h
  • LoadILLReflectometry.h
  • LoadILLSALSA.h
  • LoadILLSANS.h
  • LoadILLTOF3.h
  • LoadNXcanSAS.h
  • LoadNXSPE.h
  • LoadPLN.h
  • LoadSINQFocus.h

Related to Issue #37164
EWM 14485

To test:

This is a refactor, so ensure all current tests works.

Especially look at the LoadLotsOfFiles system test.

Tests in PR #40570 verified that Load is able to find load algorithms with a lazy descriptor.


Reviewer

Your comments will be used as part of the gatekeeper process. Comment clearly on what you have checked and tested during your review. Provide an audit trail for any changes requested.

As per the review guidelines:

  • Is the code of an acceptable quality? (Code standards/GUI standards)
  • Has a thorough functional test been performed? Do the changes handle unexpected input/situations?
  • Are appropriately scoped unit and/or system tests provided?
  • Do the release notes conform to the guidelines and describe the changes appropriately?
  • Has the relevant (user and developer) documentation been added/updated?
  • If the PR author isn’t in the mantid-developers or mantid-contributors teams, add a review comment rerun ci to authorize/rerun the CI

Gatekeeper

As per the gatekeeping guidelines:

  • Has a thorough first line review been conducted, including functional testing?
  • At a high-level, is the code quality sufficient?
  • Are the base, milestone and labels correct?

@rboston628 rboston628 added this to the Release 6.15 milestone Jan 7, 2026
@rboston628 rboston628 added the Technical Debt Marks a piece of work to address technical debt introduced to solve a problem quickly label Jan 7, 2026
@rboston628
Copy link
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

📝 Walkthrough

Walkthrough

This PR introduces a new lazy-loading Nexus descriptor pathway to optimize HDF5 file inspection in NeXus loaders. It adds a new NexusDescriptorLazy class that loads metadata on-demand, extends the FileLoaderRegistry with a NexusLazy format, introduces DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM macro for registration, and prioritizes lazy descriptor loading in the loader selection logic. Approximately 25+ file loaders across the DataHandling framework are converted from eager NexusDescriptor to NexusDescriptorLazy, including LoadBBY2, LoadEMU, multiple LoadILL\* variants, LoadISISNexus2, LoadMLZ, and others. Tests are updated to verify lazy descriptor functionality, and minor documentation fixes are made to ExperimentInfo and Run classes.

Possibly related PRs

Suggested labels

Nexus

Suggested reviewers

  • KyleQianliMa
  • jhaigh0
  • peterfpeterson
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.16% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Migrate many load algos to NexusDescriptorLazy' accurately and clearly summarizes the main change: migrating multiple loader algorithms to use a lazy Nexus descriptor variant.
Description check ✅ Passed The pull request description is related to the changeset and clearly explains the work: migrating multiple load algorithms to use NexusDescriptorLazy file descriptor.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Framework/DataHandling/src/LoadNXSPE.cpp (1)

68-85: Refactor confidence() to use lazy descriptor methods instead of eager file opening.

The confidence method accepts NexusDescriptorLazy but immediately creates a Nexus::File instance on line 72, which opens the HDF5 file eagerly. This defeats the performance benefits of lazy loading.

The established pattern across most loaders is to use lazy descriptor methods—isEntry(), hasRootAttr(), classTypeExists()—without opening the file. For example, LoadILLDiffraction and LoadILLPolarizedDiffraction use only descriptor.isEntry() calls to validate file content.

Rewrite the confidence logic to avoid opening the file directly. If the current approach is necessary, document why the eager opening is required in this specific case.

🤖 Fix all issues with AI agents
In @Framework/API/src/ExperimentInfo.cpp:
- Around line 974-976: Remove the stale TODO comment that reads "TODO load
sample and log info" immediately above the call to
loadSampleAndLogInfoNexus(file, fileInfo, prefix); since that work is already
performed by that function call; leave the two function calls
loadSampleAndLogInfoNexus(...) and loadInstrumentInfoNexus(nxFilename, file,
parameterStr) intact and do not otherwise change logic.

In @Framework/DataHandling/test/LoadBBYTest.h:
- Line 50: Remove the direct std::cout debugging prints from the LoadBBYTest
test file: delete the std::cout line that prints "Testing LoadBBY algorithm
initialization" in LoadBBYTest (and the other std::cout lines reported at lines
58, 132, 171, 200) so tests do not write to stdout; if you need progress
visibility, replace with the project logging API or CxxTest facilities rather
than using std::cout.

In @Framework/Nexus/src/NexusDescriptorLazy.cpp:
- Around line 191-193: The constructor in NexusDescriptorLazy.cpp currently
leaves m_allEntries empty when std::filesystem::exists(m_filename) is false,
which leaves m_fileID uninitialized and later breaks isEntry() and
hasRootAttr(); update the constructor to detect a non-existent m_filename and
throw the same type of exception used for invalid HDF5 files (or a
std::runtime_error with a consistent message) so callers immediately get a clear
failure instead of operating on an invalid file handle, and ensure any cleanup
or invariants for m_allEntries/m_fileID are preserved.
🧹 Nitpick comments (3)
Framework/DataHandling/src/UpdateInstrumentFromFile.cpp (1)

97-99: Consider the long-term strategy for dual descriptor usage.

Creating both NexusDescriptor and NexusDescriptorLazy instances for the same file introduces redundant HDF5 file access overhead. While the comment acknowledges this is a temporary workaround for LoadEventNexus, this pattern should be documented or tracked for future cleanup once all loaders migrate to the lazy descriptor.

Framework/DataHandling/test/LoadBBY2Test.h (1)

24-24: Consider removing console output from unit tests.

The std::cout statements on lines 24, 32, and 75 may clutter test output. CxxTest provides built-in mechanisms for test reporting. Unless these are temporary debugging aids, consider removing them to maintain clean test output.

Also applies to: 32-32, 75-75

Framework/Nexus/src/NexusDescriptorLazy.cpp (1)

33-49: String handling in readNXClass may include trailing null bytes.

The nxClass.resize(ainfo.data_size) includes the full data size from HDF5, which may include a null terminator. After H5Aread, the string might contain embedded null characters. Consider trimming the string or using strlen to determine the actual length.

♻️ Potential fix to trim trailing nulls
       if (H5Aget_info(attrID, &ainfo) >= 0) {
         nxClass.resize(ainfo.data_size);
         Mantid::Nexus::UniqueID<&H5Tclose> typeID(H5Aget_type(attrID));
         H5Aread(attrID, typeID, nxClass.data());
+        // Trim trailing null characters if present
+        if (auto pos = nxClass.find('\0'); pos != std::string::npos) {
+          nxClass.resize(pos);
+        }
       } else {
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9e2670d and 8a24857.

📒 Files selected for processing (59)
  • Framework/API/inc/MantidAPI/ExperimentInfo.h
  • Framework/API/inc/MantidAPI/FileLoaderRegistry.h
  • Framework/API/inc/MantidAPI/RegisterFileLoader.h
  • Framework/API/inc/MantidAPI/Run.h
  • Framework/API/src/ExperimentInfo.cpp
  • Framework/API/src/FileLoaderRegistry.cpp
  • Framework/DataHandling/inc/MantidDataHandling/LoadBBY2.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadEMU.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLDiffraction.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLIndirect2.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLLagrange.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLPolarizedDiffraction.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLReflectometry.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLSALSA.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLSANS.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLTOF3.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadISISNexus2.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadMLZ.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadMcStasNexus.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadNXSPE.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadNXcanSAS.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadPLN.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadQKK.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadSINQFocus.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadSassena.h
  • Framework/DataHandling/src/LoadBBY2.cpp
  • Framework/DataHandling/src/LoadEMU.cpp
  • Framework/DataHandling/src/LoadILLDiffraction.cpp
  • Framework/DataHandling/src/LoadILLIndirect2.cpp
  • Framework/DataHandling/src/LoadILLLagrange.cpp
  • Framework/DataHandling/src/LoadILLPolarizedDiffraction.cpp
  • Framework/DataHandling/src/LoadILLReflectometry.cpp
  • Framework/DataHandling/src/LoadILLSALSA.cpp
  • Framework/DataHandling/src/LoadILLSANS.cpp
  • Framework/DataHandling/src/LoadILLTOF3.cpp
  • Framework/DataHandling/src/LoadISISNexus2.cpp
  • Framework/DataHandling/src/LoadMLZ.cpp
  • Framework/DataHandling/src/LoadMcStasNexus.cpp
  • Framework/DataHandling/src/LoadNXSPE.cpp
  • Framework/DataHandling/src/LoadNXcanSAS.cpp
  • Framework/DataHandling/src/LoadPLN.cpp
  • Framework/DataHandling/src/LoadQKK.cpp
  • Framework/DataHandling/src/LoadSINQFocus.cpp
  • Framework/DataHandling/src/LoadSassena.cpp
  • Framework/DataHandling/src/UpdateInstrumentFromFile.cpp
  • Framework/DataHandling/test/LoadBBY2Test.h
  • Framework/DataHandling/test/LoadBBYTest.h
  • Framework/DataHandling/test/LoadILLIndirect2Test.h
  • Framework/DataHandling/test/LoadISISNexusTest.h
  • Framework/DataHandling/test/LoadMLZTest.h
  • Framework/DataHandling/test/LoadMcStasNexusTest.h
  • Framework/DataHandling/test/LoadQKKTest.h
  • Framework/DataHandling/test/LoadSassenaTest.h
  • Framework/Muon/inc/MantidMuon/LoadMuonNexus2.h
  • Framework/Nexus/CMakeLists.txt
  • Framework/Nexus/inc/MantidNexus/NexusDescriptorLazy.h
  • Framework/Nexus/src/NexusDescriptorLazy.cpp
  • Framework/Nexus/test/NexusDescriptorLazyTest.h
  • buildconfig/CMake/CppCheck_Suppressions.txt.in
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{cpp,cc,cxx,c++,h,hpp,hxx}

📄 CodeRabbit inference engine (AGENTS.md)

Run clang-tidy for code linting using the configuration in .clang-tidy

Files:

  • Framework/DataHandling/inc/MantidDataHandling/LoadMcStasNexus.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadEMU.h
  • Framework/DataHandling/test/LoadSassenaTest.h
  • Framework/DataHandling/src/LoadSassena.cpp
  • Framework/DataHandling/src/LoadMcStasNexus.cpp
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLSANS.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadMLZ.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLIndirect2.h
  • Framework/DataHandling/src/LoadILLSANS.cpp
  • Framework/DataHandling/src/LoadQKK.cpp
  • Framework/DataHandling/src/UpdateInstrumentFromFile.cpp
  • Framework/API/inc/MantidAPI/RegisterFileLoader.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLDiffraction.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadPLN.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadISISNexus2.h
  • Framework/DataHandling/test/LoadBBYTest.h
  • Framework/API/src/ExperimentInfo.cpp
  • Framework/DataHandling/src/LoadBBY2.cpp
  • Framework/DataHandling/src/LoadISISNexus2.cpp
  • Framework/DataHandling/src/LoadILLReflectometry.cpp
  • Framework/DataHandling/inc/MantidDataHandling/LoadNXSPE.h
  • Framework/DataHandling/src/LoadILLPolarizedDiffraction.cpp
  • Framework/DataHandling/src/LoadPLN.cpp
  • Framework/DataHandling/inc/MantidDataHandling/LoadSassena.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLReflectometry.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLLagrange.h
  • Framework/DataHandling/src/LoadNXcanSAS.cpp
  • Framework/DataHandling/test/LoadMcStasNexusTest.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadBBY2.h
  • Framework/DataHandling/src/LoadMLZ.cpp
  • Framework/DataHandling/src/LoadILLLagrange.cpp
  • Framework/DataHandling/test/LoadMLZTest.h
  • Framework/Nexus/test/NexusDescriptorLazyTest.h
  • Framework/DataHandling/test/LoadISISNexusTest.h
  • Framework/DataHandling/test/LoadQKKTest.h
  • Framework/Nexus/src/NexusDescriptorLazy.cpp
  • Framework/DataHandling/test/LoadBBY2Test.h
  • Framework/DataHandling/test/LoadILLIndirect2Test.h
  • Framework/DataHandling/src/LoadSINQFocus.cpp
  • Framework/DataHandling/src/LoadNXSPE.cpp
  • Framework/DataHandling/src/LoadEMU.cpp
  • Framework/DataHandling/inc/MantidDataHandling/LoadQKK.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadSINQFocus.h
  • Framework/DataHandling/src/LoadILLIndirect2.cpp
  • Framework/DataHandling/src/LoadILLTOF3.cpp
  • Framework/API/inc/MantidAPI/FileLoaderRegistry.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLTOF3.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadNXcanSAS.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLSALSA.h
  • Framework/DataHandling/src/LoadILLSALSA.cpp
  • Framework/Nexus/inc/MantidNexus/NexusDescriptorLazy.h
  • Framework/API/src/FileLoaderRegistry.cpp
  • Framework/DataHandling/src/LoadILLDiffraction.cpp
  • Framework/API/inc/MantidAPI/Run.h
  • Framework/Muon/inc/MantidMuon/LoadMuonNexus2.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLPolarizedDiffraction.h
  • Framework/API/inc/MantidAPI/ExperimentInfo.h
🧠 Learnings (3)
📓 Common learnings
Learnt from: rboston628
Repo: mantidproject/mantid PR: 40570
File: Framework/Nexus/src/NexusDescriptorLazy.cpp:129-130
Timestamp: 2026-01-07T17:35:58.215Z
Learning: In Framework/Nexus/src/NexusDescriptorLazy.cpp, the pattern of using std::string with HDF5's H5Gget_objname_by_idx is intentional: a string of size name_len is created, which has an underlying buffer of name_len + 1 bytes, allowing safe writes of name_len + 1 characters including the null terminator.
📚 Learning: 2026-01-07T17:35:58.215Z
Learnt from: rboston628
Repo: mantidproject/mantid PR: 40570
File: Framework/Nexus/src/NexusDescriptorLazy.cpp:129-130
Timestamp: 2026-01-07T17:35:58.215Z
Learning: In Framework/Nexus/src/NexusDescriptorLazy.cpp, the pattern of using std::string with HDF5's H5Gget_objname_by_idx is intentional: a string of size name_len is created, which has an underlying buffer of name_len + 1 bytes, allowing safe writes of name_len + 1 characters including the null terminator.

Applied to files:

  • Framework/DataHandling/inc/MantidDataHandling/LoadEMU.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLSANS.h
  • Framework/DataHandling/src/UpdateInstrumentFromFile.cpp
  • Framework/API/inc/MantidAPI/RegisterFileLoader.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLDiffraction.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadPLN.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadISISNexus2.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadNXSPE.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadSassena.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLLagrange.h
  • Framework/DataHandling/src/LoadNXcanSAS.cpp
  • Framework/DataHandling/inc/MantidDataHandling/LoadBBY2.h
  • Framework/Nexus/test/NexusDescriptorLazyTest.h
  • Framework/DataHandling/test/LoadQKKTest.h
  • Framework/Nexus/src/NexusDescriptorLazy.cpp
  • Framework/DataHandling/src/LoadNXSPE.cpp
  • Framework/Nexus/CMakeLists.txt
  • Framework/DataHandling/src/LoadEMU.cpp
  • Framework/DataHandling/inc/MantidDataHandling/LoadQKK.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadSINQFocus.h
  • Framework/API/inc/MantidAPI/FileLoaderRegistry.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadNXcanSAS.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLSALSA.h
  • Framework/Nexus/inc/MantidNexus/NexusDescriptorLazy.h
  • Framework/API/src/FileLoaderRegistry.cpp
  • Framework/DataHandling/inc/MantidDataHandling/LoadILLPolarizedDiffraction.h
📚 Learning: 2025-10-22T13:08:14.586Z
Learnt from: GuiMacielPereira
Repo: mantidproject/mantid PR: 40194
File: Framework/Algorithms/src/CreateDetectorTable.cpp:64-68
Timestamp: 2025-10-22T13:08:14.586Z
Learning: In Mantid Framework, MatrixWorkspace::getInstrument() (inherited from ExperimentInfo) throws an exception if no instrument is found rather than returning nullptr. The method dereferences the internal instrument pointer, so null-checking the return value of getInstrument() is unnecessary. Only check the objects returned by methods called on the instrument (e.g., getSample()).

Applied to files:

  • Framework/DataHandling/inc/MantidDataHandling/LoadEMU.h
  • Framework/DataHandling/inc/MantidDataHandling/LoadPLN.h
  • Framework/API/inc/MantidAPI/ExperimentInfo.h
🧬 Code graph analysis (33)
Framework/DataHandling/inc/MantidDataHandling/LoadEMU.h (2)
Framework/Nexus/inc/MantidNexus/NexusDescriptor.h (1)
  • Nexus (21-153)
Framework/Nexus/src/NexusDescriptorLazy.cpp (1)
  • NexusDescriptorLazy (56-58)
Framework/DataHandling/test/LoadSassenaTest.h (6)
Framework/Nexus/inc/MantidNexus/NexusDescriptor.h (1)
  • Nexus (21-153)
Framework/DataHandling/inc/MantidDataHandling/LoadNexusProcessed2.h (1)
  • Nexus (23-25)
Framework/DataHandling/test/LoadBBY2Test.h (1)
  • test_load_from_Load (79-86)
Framework/DataHandling/test/LoadMLZTest.h (1)
  • test_load_from_Load (70-75)
Framework/DataHandling/test/LoadISISNexusTest.h (1)
  • test_load_from_Load (1499-1505)
Framework/DataHandling/test/LoadQKKTest.h (1)
  • test_load_from_Load (76-81)
Framework/DataHandling/src/LoadSassena.cpp (6)
Framework/DataHandling/src/LoadILLSALSA.cpp (2)
  • confidence (37-44)
  • confidence (37-37)
Framework/DataHandling/src/LoadNXcanSAS.cpp (2)
  • confidence (483-499)
  • confidence (483-483)
Framework/DataHandling/src/LoadILLSANS.cpp (2)
  • confidence (72-83)
  • confidence (72-72)
Framework/DataHandling/src/LoadILLIndirect2.cpp (2)
  • confidence (62-77)
  • confidence (62-62)
Framework/DataHandling/src/LoadILLLagrange.cpp (2)
  • confidence (35-43)
  • confidence (35-35)
Framework/DataHandling/src/LoadILLDiffraction.cpp (2)
  • confidence (65-76)
  • confidence (65-65)
Framework/DataHandling/src/LoadMcStasNexus.cpp (2)
Framework/DataHandling/src/LoadILLSANS.cpp (2)
  • confidence (72-83)
  • confidence (72-72)
Framework/DataHandling/src/LoadILLIndirect2.cpp (2)
  • confidence (62-77)
  • confidence (62-62)
Framework/DataHandling/inc/MantidDataHandling/LoadILLSANS.h (6)
Framework/Nexus/inc/MantidNexus/NexusDescriptor.h (1)
  • Nexus (21-153)
Framework/Nexus/src/NexusDescriptorLazy.cpp (1)
  • NexusDescriptorLazy (56-58)
Framework/DataHandling/src/LoadSINQFocus.cpp (2)
  • confidence (64-72)
  • confidence (64-64)
Framework/DataHandling/src/LoadISISNexus2.cpp (2)
  • confidence (81-88)
  • confidence (81-81)
Framework/DataHandling/src/LoadMLZ.cpp (2)
  • confidence (102-109)
  • confidence (102-102)
Framework/DataHandling/src/LoadNexusMonitors2.cpp (1)
  • descriptor (171-171)
Framework/DataHandling/inc/MantidDataHandling/LoadILLIndirect2.h (2)
Framework/Nexus/src/NexusDescriptorLazy.cpp (1)
  • NexusDescriptorLazy (56-58)
Framework/DataHandling/src/LoadSINQFocus.cpp (2)
  • confidence (64-72)
  • confidence (64-64)
Framework/DataHandling/src/LoadQKK.cpp (8)
Framework/DataHandling/src/LoadILLSALSA.cpp (1)
  • DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM (25-27)
Framework/DataHandling/src/LoadEMU.cpp (4)
  • confidence (1186-1200)
  • confidence (1186-1186)
  • confidence (1281-1303)
  • confidence (1281-1281)
Framework/DataHandling/src/LoadSINQFocus.cpp (2)
  • confidence (64-72)
  • confidence (64-64)
Framework/DataHandling/src/LoadNXSPE.cpp (2)
  • confidence (68-85)
  • confidence (68-68)
Framework/DataHandling/src/LoadILLSANS.cpp (2)
  • confidence (72-83)
  • confidence (72-72)
Framework/DataHandling/src/LoadILLIndirect2.cpp (2)
  • confidence (62-77)
  • confidence (62-62)
Framework/DataHandling/src/LoadILLPolarizedDiffraction.cpp (2)
  • confidence (54-62)
  • confidence (54-54)
Framework/DataHandling/src/LoadILLDiffraction.cpp (2)
  • confidence (65-76)
  • confidence (65-65)
Framework/DataHandling/src/UpdateInstrumentFromFile.cpp (2)
Framework/Nexus/src/NexusDescriptor.cpp (2)
  • filename (89-89)
  • filename (89-89)
Framework/Nexus/src/NexusException.cpp (2)
  • filename (15-15)
  • filename (15-15)
Framework/API/inc/MantidAPI/RegisterFileLoader.h (2)
Framework/DataHandling/src/LoadMcStasNexus.cpp (1)
  • DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM (22-26)
Framework/DataHandling/src/LoadILLSALSA.cpp (1)
  • DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM (25-27)
Framework/DataHandling/inc/MantidDataHandling/LoadILLDiffraction.h (3)
Framework/Nexus/inc/MantidNexus/NexusDescriptor.h (1)
  • Nexus (21-153)
Framework/DataHandling/src/LoadSINQFocus.cpp (4)
  • name (48-48)
  • name (48-48)
  • confidence (64-72)
  • confidence (64-64)
Framework/DataHandling/src/LoadMLZ.cpp (4)
  • name (50-50)
  • name (50-50)
  • confidence (102-109)
  • confidence (102-102)
Framework/DataHandling/inc/MantidDataHandling/LoadISISNexus2.h (1)
Framework/Nexus/src/NexusDescriptorLazy.cpp (1)
  • NexusDescriptorLazy (56-58)
Framework/DataHandling/src/LoadBBY2.cpp (2)
Framework/DataHandling/src/LoadNXcanSAS.cpp (4)
  • confidence (483-499)
  • confidence (483-483)
  • exec (520-550)
  • exec (520-520)
Framework/DataHandling/src/LoadILLPolarizedDiffraction.cpp (4)
  • confidence (54-62)
  • confidence (54-54)
  • exec (122-139)
  • exec (122-122)
Framework/DataHandling/src/LoadILLReflectometry.cpp (5)
Framework/DataHandling/src/LoadILLSANS.cpp (2)
  • confidence (72-83)
  • confidence (72-72)
Framework/DataHandling/src/LoadILLIndirect2.cpp (2)
  • confidence (62-77)
  • confidence (62-62)
Framework/DataHandling/src/LoadILLPolarizedDiffraction.cpp (2)
  • confidence (54-62)
  • confidence (54-54)
Framework/DataHandling/src/LoadILLLagrange.cpp (2)
  • confidence (35-43)
  • confidence (35-35)
Framework/DataHandling/src/LoadILLDiffraction.cpp (2)
  • confidence (65-76)
  • confidence (65-65)
Framework/DataHandling/inc/MantidDataHandling/LoadNXSPE.h (2)
Framework/API/inc/MantidAPI/FileLoaderRegistry.h (1)
  • API (30-103)
Framework/DataHandling/src/LoadNXSPE.cpp (2)
  • confidence (68-85)
  • confidence (68-68)
Framework/DataHandling/src/LoadPLN.cpp (3)
Framework/DataHandling/src/LoadSINQFocus.cpp (2)
  • confidence (64-72)
  • confidence (64-64)
Framework/API/src/FileLoaderRegistry.cpp (2)
  • descriptor (25-25)
  • descriptor (25-25)
Framework/DataHandling/src/LoadILLSALSA.cpp (1)
  • DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM (25-27)
Framework/DataHandling/inc/MantidDataHandling/LoadILLReflectometry.h (4)
Framework/DataHandling/inc/MantidDataHandling/LoadILLPolarizedDiffraction.h (2)
  • Mantid (18-67)
  • DataHandling (19-66)
Framework/API/inc/MantidAPI/FileLoaderRegistry.h (1)
  • API (30-103)
Framework/Nexus/inc/MantidNexus/NexusDescriptor.h (1)
  • Nexus (21-153)
Framework/Nexus/src/NexusDescriptorLazy.cpp (1)
  • NexusDescriptorLazy (56-58)
Framework/DataHandling/inc/MantidDataHandling/LoadILLLagrange.h (2)
Framework/Nexus/inc/MantidNexus/NexusDescriptor.h (1)
  • Nexus (21-153)
Framework/Nexus/src/NexusDescriptorLazy.cpp (1)
  • NexusDescriptorLazy (56-58)
Framework/DataHandling/test/LoadMcStasNexusTest.h (1)
Framework/DataHandling/src/LoadMcStasNexus.cpp (2)
  • confidence (40-47)
  • confidence (40-40)
Framework/DataHandling/inc/MantidDataHandling/LoadBBY2.h (2)
Framework/Nexus/src/NexusDescriptorLazy.cpp (1)
  • NexusDescriptorLazy (56-58)
Framework/DataHandling/src/LoadBBY2.cpp (6)
  • confidence (143-165)
  • confidence (143-143)
  • init (171-226)
  • init (171-171)
  • exec (230-433)
  • exec (230-230)
Framework/DataHandling/src/LoadMLZ.cpp (5)
Framework/DataHandling/src/LoadILLSANS.cpp (2)
  • confidence (72-83)
  • confidence (72-72)
Framework/DataHandling/src/LoadILLReflectometry.cpp (2)
  • confidence (157-169)
  • confidence (157-157)
Framework/DataHandling/src/LoadILLIndirect2.cpp (2)
  • confidence (62-77)
  • confidence (62-62)
Framework/DataHandling/src/LoadILLDiffraction.cpp (2)
  • confidence (65-76)
  • confidence (65-65)
Framework/DataHandling/src/LoadISISNexus2.cpp (2)
  • confidence (81-88)
  • confidence (81-81)
Framework/DataHandling/src/LoadILLLagrange.cpp (4)
Framework/DataHandling/src/LoadILLSALSA.cpp (2)
  • confidence (37-44)
  • confidence (37-37)
Framework/DataHandling/src/LoadILLSANS.cpp (2)
  • confidence (72-83)
  • confidence (72-72)
Framework/DataHandling/src/LoadILLPolarizedDiffraction.cpp (2)
  • confidence (54-62)
  • confidence (54-54)
Framework/DataHandling/src/LoadILLDiffraction.cpp (2)
  • confidence (65-76)
  • confidence (65-65)
Framework/DataHandling/test/LoadMLZTest.h (4)
Framework/DataHandling/test/LoadBBY2Test.h (1)
  • test_load_from_Load (79-86)
Framework/DataHandling/test/LoadISISNexusTest.h (1)
  • test_load_from_Load (1499-1505)
Framework/DataHandling/test/LoadQKKTest.h (1)
  • test_load_from_Load (76-81)
Framework/DataHandling/test/LoadSassenaTest.h (1)
  • test_load_from_Load (89-94)
Framework/Nexus/test/NexusDescriptorLazyTest.h (2)
Framework/Nexus/inc/MantidNexus/NexusDescriptorLazy.h (3)
  • Mantid (17-129)
  • Nexus (18-128)
  • string (47-86)
Framework/Nexus/src/NexusDescriptorLazy.cpp (1)
  • NexusDescriptorLazy (56-58)
Framework/DataHandling/test/LoadISISNexusTest.h (4)
Framework/DataHandling/test/LoadBBY2Test.h (1)
  • test_load_from_Load (79-86)
Framework/DataHandling/test/LoadMLZTest.h (1)
  • test_load_from_Load (70-75)
Framework/DataHandling/test/LoadQKKTest.h (1)
  • test_load_from_Load (76-81)
Framework/DataHandling/test/LoadSassenaTest.h (1)
  • test_load_from_Load (89-94)
Framework/DataHandling/test/LoadQKKTest.h (2)
Framework/Nexus/inc/MantidNexus/NexusDescriptorLazy.h (1)
  • Nexus (18-128)
Framework/Nexus/inc/MantidNexus/NexusDescriptor.h (1)
  • Nexus (21-153)
Framework/DataHandling/test/LoadILLIndirect2Test.h (1)
Framework/Nexus/inc/MantidNexus/NexusDescriptor.h (1)
  • Nexus (21-153)
Framework/DataHandling/src/LoadSINQFocus.cpp (5)
Framework/DataHandling/src/LoadMcStasNexus.cpp (1)
  • DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM (22-26)
Framework/DataHandling/src/LoadILLPolarizedDiffraction.cpp (2)
  • confidence (54-62)
  • confidence (54-54)
Framework/DataHandling/src/LoadISISNexus2.cpp (2)
  • confidence (81-88)
  • confidence (81-81)
Framework/DataHandling/src/LoadMLZ.cpp (2)
  • confidence (102-109)
  • confidence (102-102)
Framework/API/src/FileLoaderRegistry.cpp (2)
  • descriptor (25-25)
  • descriptor (25-25)
Framework/DataHandling/src/LoadNXSPE.cpp (8)
Framework/DataHandling/src/LoadMcStasNexus.cpp (2)
  • confidence (40-47)
  • confidence (40-40)
Framework/DataHandling/src/LoadILLSANS.cpp (2)
  • confidence (72-83)
  • confidence (72-72)
Framework/DataHandling/src/LoadILLReflectometry.cpp (2)
  • confidence (157-169)
  • confidence (157-157)
Framework/DataHandling/src/LoadILLIndirect2.cpp (2)
  • confidence (62-77)
  • confidence (62-62)
Framework/DataHandling/src/LoadILLPolarizedDiffraction.cpp (2)
  • confidence (54-62)
  • confidence (54-54)
Framework/DataHandling/src/LoadILLLagrange.cpp (2)
  • confidence (35-43)
  • confidence (35-35)
Framework/DataHandling/src/LoadILLDiffraction.cpp (2)
  • confidence (65-76)
  • confidence (65-65)
Framework/API/src/FileLoaderRegistry.cpp (2)
  • descriptor (25-25)
  • descriptor (25-25)
Framework/DataHandling/src/LoadEMU.cpp (4)
Framework/DataHandling/src/LoadMcStasNexus.cpp (5)
  • confidence (40-47)
  • confidence (40-40)
  • exec (66-177)
  • exec (66-66)
  • DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM (22-26)
Framework/DataHandling/src/LoadPLN.cpp (6)
  • confidence (829-843)
  • confidence (829-829)
  • exec (521-637)
  • exec (521-521)
  • exec (848-911)
  • exec (848-848)
Framework/DataHandling/src/LoadISISNexus2.cpp (4)
  • confidence (81-88)
  • confidence (81-81)
  • exec (138-390)
  • exec (138-138)
Framework/DataHandling/src/LoadNexusProcessed.cpp (2)
  • confidence (197-202)
  • confidence (197-197)
Framework/DataHandling/inc/MantidDataHandling/LoadILLTOF3.h (1)
Framework/DataHandling/inc/MantidDataHandling/LoadNXSPE.h (1)
  • DataHandling (15-42)
Framework/DataHandling/inc/MantidDataHandling/LoadNXcanSAS.h (3)
Framework/API/inc/MantidAPI/FileLoaderRegistry.h (1)
  • API (30-103)
Framework/Nexus/inc/MantidNexus/NexusDescriptor.h (1)
  • Nexus (21-153)
Framework/DataHandling/src/LoadNXcanSAS.cpp (2)
  • confidence (483-499)
  • confidence (483-483)
Framework/Nexus/inc/MantidNexus/NexusDescriptorLazy.h (1)
Framework/Nexus/src/NexusDescriptorLazy.cpp (11)
  • NexusDescriptorLazy (56-58)
  • hasRootAttr (93-104)
  • hasRootAttr (93-93)
  • isEntry (60-83)
  • isEntry (60-60)
  • classTypeExists (89-91)
  • classTypeExists (89-89)
  • initAllEntries (144-196)
  • initAllEntries (144-144)
  • loadGroups (108-142)
  • loadGroups (108-109)
Framework/DataHandling/inc/MantidDataHandling/LoadILLPolarizedDiffraction.h (5)
Framework/Nexus/inc/MantidNexus/NexusDescriptor.h (1)
  • Nexus (21-153)
Framework/Nexus/src/NexusDescriptorLazy.cpp (1)
  • NexusDescriptorLazy (56-58)
Framework/DataHandling/src/LoadMLZ.cpp (6)
  • name (50-50)
  • name (50-50)
  • category (56-56)
  • category (56-56)
  • confidence (102-109)
  • confidence (102-102)
Framework/DataHandling/inc/MantidDataHandling/LoadNexusProcessed.h (1)
  • vector (64-104)
Framework/DataHandling/src/LoadILLReflectometry.cpp (2)
  • confidence (157-169)
  • confidence (157-157)
🪛 Cppcheck (2.19.0)
Framework/DataHandling/src/LoadSassena.cpp

[error] 26-26: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

Framework/DataHandling/src/LoadMcStasNexus.cpp

[error] 22-22: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

Framework/DataHandling/src/LoadILLSANS.cpp

[error] 40-40: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

Framework/DataHandling/src/LoadQKK.cpp

[error] 31-31: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

Framework/DataHandling/src/LoadBBY2.cpp

[error] 53-53: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

Framework/DataHandling/src/LoadILLReflectometry.cpp

[error] 149-149: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

Framework/DataHandling/src/LoadILLPolarizedDiffraction.cpp

[error] 51-51: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

Framework/DataHandling/src/LoadNXcanSAS.cpp

[error] 478-478: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

Framework/DataHandling/src/LoadMLZ.cpp

[error] 39-39: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

Framework/DataHandling/src/LoadILLLagrange.cpp

[error] 32-32: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

Framework/DataHandling/src/LoadSINQFocus.cpp

[error] 33-33: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

Framework/DataHandling/src/LoadILLIndirect2.cpp

[error] 38-38: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

Framework/DataHandling/src/LoadILLTOF3.cpp

[error] 33-33: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

Framework/DataHandling/src/LoadILLSALSA.cpp

[error] 25-25: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

Framework/DataHandling/src/LoadILLDiffraction.cpp

[error] 62-62: There is an unknown macro here somewhere. Configuration is required. If DECLARE_NEXUS_LAZY_FILELOADER_ALGORITHM is a macro then please configure it.

(unknownMacro)

some fixes

some changes to NexusDescriptorLazy

fix some comment line spacings

fix some muon loading algorithms

add new file loader type

fix LoadMLZ

fix LoadSassena

add file loader registry path

nexus descriptor first entry, and LoadQKK

fix LoadBBY2

fix LoadISISNexus2

save progress

small fixes

add canLoad and use ordered map

revert LoadMuonNexusV2 -- causes segfaults in LoadMuonNexus3

forgot to save before pushing
Copy link
Contributor

@searscr searscr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strait forward refactor to use lazy Nexus file descriptor.

@SilkeSchomann SilkeSchomann self-assigned this Jan 9, 2026
@SilkeSchomann SilkeSchomann merged commit d680337 into main Jan 9, 2026
10 checks passed
@SilkeSchomann SilkeSchomann deleted the ewm14485-migrate-many branch January 9, 2026 07:57
SilkeSchomann pushed a commit that referenced this pull request Jan 9, 2026
### Description of work

In PR #40570, a new file descriptor, `NexusDescriptorLazy`, was created
for shallow and lazy checking of files as part of the `Load` algorithm's
confidence check.

Many algorithms could be migrated mechanically, as in PR #40583.

This PR is migrating the algorithm `LoadMcStasNexus` algorithm. This is
different from the `LoadMcStas` algorithm. It was first implemented
thirteen years ago in PR #1, and marked as experimental. And so it has
stayed. There is apparently a pre-release paper about this algo.
https://arxiv.org/abs/1607.02498

In Issue #7768, it was given a test data file. More discussion is
available at [this
ticket](https://trac.mantidproject.org/mantid/ticket/6922).

The confidence check for `LoadMcStasNexus` was first added in PR #32006.
According to comments there, it is enough to check for an `information`
dataset written by McCode:
``` cpp
// Mccode writes an information dataset so can be reasonably confident if we find it
```

This PR has pinpointed one particular place to check for that dataset,
namely off of the instrument address. This seems to work, rather than
checking literally the entire file tree.

Related to Issue #37164 
[EWM
14485](https://ornlrse.clm.ibmcloud.com/ccm/web/projects/Neutron%20Data%20Project%20%28Change%20Management%29#action=com.ibm.team.workitem.viewWorkItem&id=14485)


### To test:

This is a refactor, so ensure all current tests works. A new test was
added to make sure the confidence method is calculating correctly for
the only example of a file needing this algorithm that anyone knows of.

Especially look at the `LoadLotsOfFiles` system test.

Tests in PR #40570 verified that `Load` is able to find load algorithms
with a lazy descriptor.
KedoKudo pushed a commit that referenced this pull request Jan 9, 2026
### Description of work

In PR #40570, a new file descriptor, `NexusDescriptorLazy`, was created
for shallow and lazy checking of files as part of the `Load` algorithm's
confidence check.

Many algorithms could be migrated mechanically, as in PR #40583.

This PR is migrating the algorithm `LoadNXSPE` algorithm. Part of its
confidence check looks for a `"definition"` dataset off of an `NXEntry`
group, and then verifies the definition is equal to `"NXSPE"` or
similar.

To make this work, this added a new method to `NexusDescriptorLazy` to
load string data. Thus made use of the `H5Cpp` package because frankly
trying to read string data is a complete nightmare using the C-API.

Related to Issue #37164 
[EWM
14485](https://ornlrse.clm.ibmcloud.com/ccm/web/projects/Neutron%20Data%20Project%20%28Change%20Management%29#action=com.ibm.team.workitem.viewWorkItem&id=14485)

### To test:

This is a refactor, so ensure all current tests works. A test of the
confidence calculation already existed, and a new one was added to make
sure `Load` can still correctly find this loader.

Especially look at the `LoadLotsOfFiles` system test.

Tests in PR #40570 verified that `Load` is able to find load algorithms
with a lazy descriptor.

<!--  GATEKEEPER: When squashing, remove the section from HERE...  -->
---

### Reviewer

**Your comments will be used as part of the gatekeeper process.**
Comment clearly on what you have checked and tested during your review.
Provide an audit trail for any changes requested.

As per the [review
guidelines](http://developer.mantidproject.org/ReviewingAPullRequest.html):

- Is the code of an acceptable quality? ([Code
standards](http://developer.mantidproject.org/Standards/)/[GUI
standards](http://developer.mantidproject.org/Standards/GUIStandards.html))
- Has a thorough functional test been performed? Do the changes handle
unexpected input/situations?
- Are appropriately scoped unit and/or system tests provided?
- Do the release notes conform to the
[guidelines](https://developer.mantidproject.org/Standards/ReleaseNotesGuide.html)
and describe the changes appropriately?
- Has the relevant (user and developer) documentation been
added/updated?
- If the PR author isn’t in the `mantid-developers` or
`mantid-contributors` teams, add a review comment `rerun ci` to
authorize/rerun the CI

### Gatekeeper

As per the [gatekeeping
guidelines](https://developer.mantidproject.org/Gatekeeping.html):

- Has a thorough first line review been conducted, including functional
testing?
- At a high-level, is the code quality sufficient?
- Are the base, milestone and labels correct?
<!--  GATEKEEPER: ...To HERE  -->
rboston628 added a commit that referenced this pull request Jan 9, 2026
### Description of work

In PR #40570, a new file descriptor, `NexusDescriptorLazy`, was created
for shallow and lazy checking of files as part of the `Load` algorithm's
confidence check. There, only a few algorithms were migrated over.

In this PR, we migrate over the following to use the new file
descriptor:
- `LoadEMU.h`
- `LoadILLDiffraction.h`
- `LoadILLIndirect2.h`
- `LoadILLLagrange.h`
- `LoadILLPolarizedDiffraction.h`
- `LoadILLReflectometry.h`
- `LoadILLSALSA.h`
- `LoadILLSANS.h`
- `LoadILLTOF3.h`
- `LoadNXcanSAS.h`
- `LoadNXSPE.h`
- `LoadPLN.h`
- `LoadSINQFocus.h`


Related to Issue #37164 
[EWM
14485](https://ornlrse.clm.ibmcloud.com/ccm/web/projects/Neutron%20Data%20Project%20%28Change%20Management%29#action=com.ibm.team.workitem.viewWorkItem&id=14485)


### To test:

This is a refactor, so ensure all current tests works.

Especially look at the `LoadLotsOfFiles` system test.

Tests in PR #40570 verified that `Load` is able to find load algorithms
with a lazy descriptor.
rboston628 added a commit that referenced this pull request Jan 9, 2026
### Description of work

In PR #40570, a new file descriptor, `NexusDescriptorLazy`, was created
for shallow and lazy checking of files as part of the `Load` algorithm's
confidence check.

Many algorithms could be migrated mechanically, as in PR #40583.

This PR is migrating the algorithm `LoadNXSPE` algorithm. Part of its
confidence check looks for a `"definition"` dataset off of an `NXEntry`
group, and then verifies the definition is equal to `"NXSPE"` or
similar.

To make this work, this added a new method to `NexusDescriptorLazy` to
load string data. Thus made use of the `H5Cpp` package because frankly
trying to read string data is a complete nightmare using the C-API.

Related to Issue #37164 
[EWM
14485](https://ornlrse.clm.ibmcloud.com/ccm/web/projects/Neutron%20Data%20Project%20%28Change%20Management%29#action=com.ibm.team.workitem.viewWorkItem&id=14485)

### To test:

This is a refactor, so ensure all current tests works. A test of the
confidence calculation already existed, and a new one was added to make
sure `Load` can still correctly find this loader.

Especially look at the `LoadLotsOfFiles` system test.

Tests in PR #40570 verified that `Load` is able to find load algorithms
with a lazy descriptor.

<!--  GATEKEEPER: When squashing, remove the section from HERE...  -->
---

### Reviewer

**Your comments will be used as part of the gatekeeper process.**
Comment clearly on what you have checked and tested during your review.
Provide an audit trail for any changes requested.

As per the [review
guidelines](http://developer.mantidproject.org/ReviewingAPullRequest.html):

- Is the code of an acceptable quality? ([Code
standards](http://developer.mantidproject.org/Standards/)/[GUI
standards](http://developer.mantidproject.org/Standards/GUIStandards.html))
- Has a thorough functional test been performed? Do the changes handle
unexpected input/situations?
- Are appropriately scoped unit and/or system tests provided?
- Do the release notes conform to the
[guidelines](https://developer.mantidproject.org/Standards/ReleaseNotesGuide.html)
and describe the changes appropriately?
- Has the relevant (user and developer) documentation been
added/updated?
- If the PR author isn’t in the `mantid-developers` or
`mantid-contributors` teams, add a review comment `rerun ci` to
authorize/rerun the CI

### Gatekeeper

As per the [gatekeeping
guidelines](https://developer.mantidproject.org/Gatekeeping.html):

- Has a thorough first line review been conducted, including functional
testing?
- At a high-level, is the code quality sufficient?
- Are the base, milestone and labels correct?
<!--  GATEKEEPER: ...To HERE  -->
rboston628 added a commit that referenced this pull request Jan 9, 2026
### Description of work

In PR #40570, a new file descriptor, `NexusDescriptorLazy`, was created
for shallow and lazy checking of files as part of the `Load` algorithm's
confidence check.

Many algorithms could be migrated mechanically, as in PR #40583.

This PR is migrating the algorithm `LoadMcStasNexus` algorithm. This is
different from the `LoadMcStas` algorithm. It was first implemented
thirteen years ago in PR #1, and marked as experimental. And so it has
stayed. There is apparently a pre-release paper about this algo.
https://arxiv.org/abs/1607.02498

In Issue #7768, it was given a test data file. More discussion is
available at [this
ticket](https://trac.mantidproject.org/mantid/ticket/6922).

The confidence check for `LoadMcStasNexus` was first added in PR #32006.
According to comments there, it is enough to check for an `information`
dataset written by McCode:
``` cpp
// Mccode writes an information dataset so can be reasonably confident if we find it
```

This PR has pinpointed one particular place to check for that dataset,
namely off of the instrument address. This seems to work, rather than
checking literally the entire file tree.

Related to Issue #37164 
[EWM
14485](https://ornlrse.clm.ibmcloud.com/ccm/web/projects/Neutron%20Data%20Project%20%28Change%20Management%29#action=com.ibm.team.workitem.viewWorkItem&id=14485)


### To test:

This is a refactor, so ensure all current tests works. A new test was
added to make sure the confidence method is calculating correctly for
the only example of a file needing this algorithm that anyone knows of.

Especially look at the `LoadLotsOfFiles` system test.

Tests in PR #40570 verified that `Load` is able to find load algorithms
with a lazy descriptor.
rboston628 added a commit that referenced this pull request Jan 9, 2026
Sister to PRs:
- PR #40583
- PR #40589
- PR #40591
KedoKudo pushed a commit that referenced this pull request Jan 9, 2026
### Description of work

In PR #40570, a new file descriptor, `NexusDescriptorLazy`, was created
for shallow and lazy checking of files as part of the `Load` algorithm's
confidence check.

Many algorithms could be migrated mechanically, as in PR #40583.

This PR is migrating the algorithm `LoadNexusProcessed` algorithm. Its
confidence check is trivially portable. However, this inherited from
`NexusFileLoader`, which requires a `NexusDescriptor` for the confidence
check. One location in the code relied on the inherited
`NexusDescriptor`, so that it could not be trivially migrated to use the
lazy version.

This adds a new method to `Nexus::File` which passes through to the
`NexusDescriptor` to call its `classNameExists` method, which is what is
actually needed inside this load algo. With that, the `NexusDecriptor`
is no longer needed and this can be set to inherit from
`IFileLoader<NexusDescriptorLazy>`.

Related to Issue #37164 
[EWM
14485](https://ornlrse.clm.ibmcloud.com/ccm/web/projects/Neutron%20Data%20Project%20%28Change%20Management%29#action=com.ibm.team.workitem.viewWorkItem&id=14485)

### To test:

This is a refactor, so ensure all current tests works. A test of the
confidence calculation already existed, and a new one was added to make
sure `Load` can still correctly find this loader.

Especially look at the `LoadLotsOfFiles` system test.

Tests in PR #40570 verified that `Load` is able to find load algorithms
with a lazy descriptor.

<!--  GATEKEEPER: When squashing, remove the section from HERE...  -->
---

### Reviewer

**Your comments will be used as part of the gatekeeper process.**
Comment clearly on what you have checked and tested during your review.
Provide an audit trail for any changes requested.

As per the [review
guidelines](http://developer.mantidproject.org/ReviewingAPullRequest.html):

- Is the code of an acceptable quality? ([Code
standards](http://developer.mantidproject.org/Standards/)/[GUI
standards](http://developer.mantidproject.org/Standards/GUIStandards.html))
- Has a thorough functional test been performed? Do the changes handle
unexpected input/situations?
- Are appropriately scoped unit and/or system tests provided?
- Do the release notes conform to the
[guidelines](https://developer.mantidproject.org/Standards/ReleaseNotesGuide.html)
and describe the changes appropriately?
- Has the relevant (user and developer) documentation been
added/updated?
- If the PR author isn’t in the `mantid-developers` or
`mantid-contributors` teams, add a review comment `rerun ci` to
authorize/rerun the CI

### Gatekeeper

As per the [gatekeeping
guidelines](https://developer.mantidproject.org/Gatekeeping.html):

- Has a thorough first line review been conducted, including functional
testing?
- At a high-level, is the code quality sufficient?
- Are the base, milestone and labels correct?
<!--  GATEKEEPER: ...To HERE  -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Technical Debt Marks a piece of work to address technical debt introduced to solve a problem quickly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants