Skip to content
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 hdf4 support from NexusCpp #38954

Merged
merged 16 commits into from
Mar 4, 2025

Conversation

peterfpeterson
Copy link
Member

@peterfpeterson peterfpeterson commented Feb 24, 2025

This removes hdf4 from FrameworkNexus in its entirety.

LoadILLTOF2 was converted to use LegacyNexus (to support legacy hdf4 files) and LoadILLTOF3 is a copy that uses Nexus (hdf5). There is also a new set of tests for FileLoaderRegistry which helped figure out which loaders support which backend.

The change to LegacyNexus's make is because I discovered it was using set_target_properties incorrectly and the flag was making it in through find cmake find modules.

Refs #38332

To test:

This is mostly a refactor of code and additional unit tests were added to help verify it is working.

This does not require release notes because it is part of the nexus API consolidation which will have a more extensive write-up.


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

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

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

@peterfpeterson peterfpeterson added Maintenance Unassigned issues to be addressed in the next maintenance period. Technical Debt Marks a piece of work to address technical debt introduced to solve a problem quickly labels Feb 24, 2025
@peterfpeterson peterfpeterson added this to the Release 6.13 milestone Feb 24, 2025
@peterfpeterson peterfpeterson force-pushed the 38332_disable_hdf4 branch 5 times, most recently from 2cd36c9 to 344015c Compare February 26, 2025 17:01
@github-actions github-actions bot added the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 26, 2025
Copy link

👋 Hi, @peterfpeterson,

Conflicts have been detected against the base branch. Please rebase your branch against the base branch.

@peterfpeterson peterfpeterson force-pushed the 38332_disable_hdf4 branch 2 times, most recently from 14777bf to 971c9cc Compare February 26, 2025 22:06
@github-actions github-actions bot added Has Conflicts Used by the bot to label pull requests that have conflicts and removed Has Conflicts Used by the bot to label pull requests that have conflicts labels Feb 27, 2025
Copy link

👋 Hi, @peterfpeterson,

Conflicts have been detected against the base branch. Please rebase your branch against the base branch.

@peterfpeterson peterfpeterson removed the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 27, 2025
@peterfpeterson peterfpeterson marked this pull request as ready for review February 27, 2025 20:39
Copy link
Contributor

@rboston628 rboston628 left a comment

Choose a reason for hiding this comment

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

I'm not sure how to review LoadILLTOF3, and will need to do that tomorrow. Here are some comments on the rest

@@ -262,7 +262,7 @@ class LoadDetectorInfoTest : public CxxTest::TestSuite {

makeTestWorkspace(SmallTestDatFile::NDETECTS, NBINS, m_InoutWS);
loadDetInfo.setPropertyValue("Workspace", m_InoutWS);
loadDetInfo.setPropertyValue("DataFilename", "argus0026287.nxs");
loadDetInfo.setPropertyValue("DataFilename", "ARGUS00073601.nxs");
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this change necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

That was a fix from Ross. I assume that it was an issue with FileFinder / ArchiveSearch forgetting what the instrument is

Copy link
Contributor

Choose a reason for hiding this comment

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

But doesn't changing the file used for the test, effectively change what the test is testing? If it was necessary, it suggests some behavior changed

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure why. It is a Ross change

Copy link
Contributor

Choose a reason for hiding this comment

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

@rosswhitfield Was this change necessary, or is this file just faster to work with?

Copy link
Contributor

Choose a reason for hiding this comment

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

@MialLewis is this instrument a muon instrument?

Copy link
Member Author

Choose a reason for hiding this comment

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

This appears to be another hidden hdf4 based usage. For most everything else we've copied the code into the LegacyNexus portion of things. However, the way LoadDetectorInfo is used by muons isn't entirely clear. We need @MialLewis's advice

$  rg LoadDetectorInfo -l -t cpp -t py | grep -v LoadDetectorInfo
scripts/Inelastic/Direct/RunDescriptor.py
Testing/SystemTests/tests/framework/LoadLotsOfFiles.py
Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I changed the test data from a HDF4 file to HDF5 just to get the test to pass but we should check if they need LoadDetectorInfo to support HDF4.

I also removed the HDF4 file from the StartAndEndTimeFromNexusFileExtractorTest because I didn't see any HDF4 algorithms using the extractStartTime or extractEndTime functions.

Copy link
Contributor

Choose a reason for hiding this comment

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

ARGUS is indeed a Muon instrument - I've passed this question on to a Muon scientist to see if they actually use this algorithm.

Copy link
Member Author

Choose a reason for hiding this comment

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

Documenting the discussion that happened on slack. This particular issue (ARGUS) is being resolved by deleting it for now. If we need it later, the code will be resurrected.

@peterfpeterson peterfpeterson force-pushed the 38332_disable_hdf4 branch 2 times, most recently from 9d622ee to 204b4bc Compare March 3, 2025 15:52
@github-actions github-actions bot added the Has Conflicts Used by the bot to label pull requests that have conflicts label Mar 3, 2025
Copy link

github-actions bot commented Mar 3, 2025

👋 Hi, @peterfpeterson,

Conflicts have been detected against the base branch. Please rebase your branch against the base branch.

@peterfpeterson peterfpeterson removed the Has Conflicts Used by the bot to label pull requests that have conflicts label Mar 4, 2025
By not suggesting a loader, this uses generic load which correctly
selects the correct version of LoadILLTOF.
Copy link
Contributor

@rboston628 rboston628 left a comment

Choose a reason for hiding this comment

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

I am accepting the ARGUS issue as resolved. That was my only hesitation. All looks good.

@KedoKudo KedoKudo merged commit 669dd76 into mantidproject:main Mar 4, 2025
10 checks passed
@peterfpeterson peterfpeterson deleted the 38332_disable_hdf4 branch March 4, 2025 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Unassigned issues to be addressed in the next maintenance period. 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.

6 participants