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

Refactor SaveNXcanSAS algorithm to support different variants #38582

Merged
merged 9 commits into from
Jan 13, 2025

Conversation

adriazalvarez
Copy link
Contributor

@adriazalvarez adriazalvarez commented Jan 9, 2025

Description of work

This PR refactors current implementation of the SaveNXcanSAS algorithm to allow multiple variants of algorithms saving in NXcanSAS format ( like polarized data). Explained in #38503

The refactoring has mainly reorganized the code, the SaveNXcanSAS algorithm is now derived from a parent SaveNXcanSASBase which contains different initializers and validator functions that specialize the algorithm to support different kinds of data and metadata. At this moment, it validates and adds what is considered standard metadata for a NXcanSAS format.
A helper file has been also created to place common functions that add different groups and data to the H5 file. These were previously stored in an anonymous namespace in the SaveNXcanSAS algorithm, and now are accessible to other algorithms through the NXcanSAS namespace.

Summary of work

Fixes #38503.

Further detail of work

To test:

  • SaveNXcanSAS algorithm tests are passing in the CI.
  • Code review

this does not required release notes as it is an internal reorganization and does not affect the user experience


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.

1. There were doxygen lines in add2DData function that needed to be escaped with \. to avoid a warning, this was not detected before
as doxygen does not look in anonymous namespaces for mantid.
2. There was a doxygen comment missing input parameters to the function addInstrument.
@adriazalvarez adriazalvarez added SANS Issues and pull requests related to SANS ISIS Team: LSS Issue and pull requests managed by the LSS subteam at ISIS labels Jan 10, 2025
@adriazalvarez adriazalvarez marked this pull request as ready for review January 10, 2025 10:09
@sf1919
Copy link
Contributor

sf1919 commented Jan 13, 2025

Can we get a milestone on this please?

@adriazalvarez adriazalvarez added this to the Release 6.12 milestone Jan 13, 2025
@GuiMacielPereira GuiMacielPereira self-assigned this Jan 13, 2025
Copy link
Contributor

@GuiMacielPereira GuiMacielPereira left a comment

Choose a reason for hiding this comment

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

SaveNXcanSAS.cpp was split into SaveNXcanSASBase.cpp and NXcanSASHelper.cpp, to prepare the base class for creating another diverging algorithm as specified by the original issue. The code looks good and from what I can tell no major changes were introduced.

There was no change to the unit tests, so checking that they run is enough to check that these changes were not disruptive.

I searched the logs from the CI to check these tests ran without issues and confirmed this was the case 👍

@SilkeSchomann SilkeSchomann self-assigned this Jan 13, 2025
@SilkeSchomann SilkeSchomann merged commit 61bf054 into main Jan 13, 2025
10 checks passed
@SilkeSchomann SilkeSchomann deleted the refactor_Save_NXcanSAS branch January 13, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ISIS Team: LSS Issue and pull requests managed by the LSS subteam at ISIS SANS Issues and pull requests related to SANS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Polarized SANS metadata: refactor SaveNXcanSAS to support multiple variants of the algorithm
4 participants