Skip to content

Conversation

@EmilyBourne
Copy link
Collaborator

The float conversion warning which is raised when a floating point number is truncated to an integer can catch errors (e.g. in #138 I passed a coordinate (double) to a function taking indices (int) by accident but no warning was raised). This warning is therefore added. Warnings arising as a result are fixed with a static_cast.

Several of the warnings are associated with expressions like int powerOf2 = pow(2, n) these are changed to use bit arithmetic (int powerOf2 = 1 << n) with an explanatory comment as this avoids the need for doubles and requires fewer FLOPs.

Merge Request - GuideLine Checklist

Guideline to check code before resolve WIP and approval, respectively.
As many checkboxes as possible should be ticked.

Checks by code author:

Always to be checked:

  • There is at least one issue associated with the pull request.
  • New code adheres with the coding guidelines
  • No large data files have been added to the repository. Maximum size for files should be of the order of KB not MB. In particular avoid adding of pdf, word, or other files that cannot be change-tracked correctly by git.

If functions were changed or functionality was added:

  • Tests for new functionality has been added
  • A local test was succesful

If new functionality was added:

  • There is appropriate documentation of your work. (use doxygen style comments)

If new third party software is used:

  • Did you pay attention to its license? Please remember to add it to the wiki after successful merging.

If new mathematical methods or epidemiological terms are used:

  • Are new methods referenced? Did you provide further documentation?

Checks by code reviewer(s):

  • Is the code clean of development artifacts e.g., unnecessary comments, prints, ...
  • The ticket goals for each associated issue are reached or problems are clearly addressed (i.e., a new issue was introduced).
  • There are appropriate unit tests and they pass.
  • The git history is clean and linearized for the merge request. All reviewers should squash commits and write a simple and meaningful commit message.
  • Coverage report for new code is acceptable.
  • No large data files have been added to the repository. Maximum size for files should be of the order of KB not MB. In particular avoid adding of pdf, word, or other files that cannot be change-tracked correctly by git.

@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.28%. Comparing base (82c83f2) to head (b8ed276).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/PolarGrid/anisotropic_division.cpp 77.77% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #139   +/-   ##
=======================================
  Coverage   88.28%   88.28%           
=======================================
  Files          89       89           
  Lines        5276     5276           
=======================================
  Hits         4658     4658           
  Misses        618      618           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@julianlitz julianlitz left a comment

Choose a reason for hiding this comment

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

You are absolutely right.
The std::pow signature does not provide an overload for integer bases and thus the previous implementation can yield wrong results. Well spotted and an important fix.

@EmilyBourne EmilyBourne merged commit e1898b3 into main Dec 29, 2025
8 checks passed
@EmilyBourne EmilyBourne deleted the ebourne_float_conversion branch December 29, 2025 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants