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

Change integer type of Mantid:Nexus::NXInfo #38805

Merged
merged 3 commits into from
Feb 20, 2025

Conversation

peterfpeterson
Copy link
Member

@peterfpeterson peterfpeterson commented Feb 7, 2025

Since nexus actually works with int64_t, change the integer type in NexusClasses.h's NXInfo to match the representation.

This is intended to support #38791 and isolate potential issues because it is a much more substantial change.

Refs #38332

To test:

This changes an internal type from int to int64_t and existing tests will pick up any issues caused by it.

This does not require release notes because it is a code refactor with no user facing changes.


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 changed the title Change integer type Change integer type of Mantid:Nexus::NXInfo Feb 7, 2025
@peterfpeterson
Copy link
Member Author

This is no longer needed

@peterfpeterson peterfpeterson deleted the nxclass_int64 branch February 10, 2025 14:20
@peterfpeterson peterfpeterson restored the nxclass_int64 branch February 10, 2025 18:19
@peterfpeterson peterfpeterson force-pushed the nxclass_int64 branch 3 times, most recently from fbca2b5 to 5c550b0 Compare February 10, 2025 20:15
@github-actions github-actions bot added the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 10, 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 nxclass_int64 branch 2 times, most recently from e08c226 to 259a147 Compare February 11, 2025 14:49
@peterfpeterson peterfpeterson removed the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 11, 2025
@peterfpeterson peterfpeterson marked this pull request as ready for review February 11, 2025 17:48
@peterfpeterson peterfpeterson added this to the Release 6.13 milestone Feb 11, 2025
@peterfpeterson peterfpeterson added the Maintenance Unassigned issues to be addressed in the next maintenance period. label Feb 11, 2025
@@ -295,7 +295,7 @@ Workspace_sptr LoadNexusProcessed::doAccelleratedMultiPeriodLoading(NXRoot &root
NXDataSetTyped<double> errors(wsEntry, "errors");
errors.openLocal();

const int nChannels = data.dim1();
const int nChannels = static_cast<int>(data.dim1());
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be declared int64_t?

Copy link
Member Author

Choose a reason for hiding this comment

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

There is too much pointer math in this section to edit as part of this PR. It deserves a harder look

@@ -489,7 +489,7 @@ Workspace_sptr LoadMuonNexus1::loadDetectorGrouping(NXRoot &root, const Geometry
NXInt groupingData = dataEntry.openNXInt("grouping");
groupingData.load();

int numGroupingEntries = groupingData.dim0();
int numGroupingEntries = static_cast<int>(groupingData.dim0());
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this not be int64_t or size_t?

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 started down this path and it got ugly really fast

@@ -931,14 +931,14 @@ void LoadNexusProcessed::loadV3DColumn(Mantid::NeXus::NXDouble &data, const API:
if (!columnTitle.empty()) {
ColumnVector<V3D> col = tableWs->addColumn("V3D", columnTitle);

const int rowCount = data.dim0();
const int64_t rowCount = data.dim0();
Copy link
Contributor

Choose a reason for hiding this comment

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

Not related to your PR, but it annoys me that L848 and L851 above use dims[] and L934 uses dim0().

Copy link
Contributor

Choose a reason for hiding this comment

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

This might also need a cast operation, as above

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 messing with these

Copy link

👋 Hi, @peterfpeterson,

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

@github-actions github-actions bot added the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 13, 2025
@peterfpeterson peterfpeterson added the Technical Debt Marks a piece of work to address technical debt introduced to solve a problem quickly label Feb 17, 2025
@peterfpeterson peterfpeterson removed the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 18, 2025
@github-actions github-actions bot added the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 18, 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 19, 2025
@github-actions github-actions bot added the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 20, 2025
Copy link

👋 Hi, @peterfpeterson,

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

@github-actions github-actions bot removed the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 20, 2025
@github-actions github-actions bot added the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 20, 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 nxclass_int64 branch 2 times, most recently from 9734f34 to c01c3bf Compare February 20, 2025 20:46
Since nexus actually works with int64_t, change the integer type in
nxinfo to match
@peterfpeterson peterfpeterson removed the Has Conflicts Used by the bot to label pull requests that have conflicts label Feb 20, 2025
@rosswhitfield rosswhitfield merged commit d17c62a into mantidproject:main Feb 20, 2025
10 checks passed
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.

3 participants