Skip to content

Conversation

@reneSchm
Copy link
Member

@reneSchm reneSchm commented Apr 9, 2024

Changes and Information

Please briefly list the changes (main added features, changed items, or corrected bugs) made:

  • Check whether an IntegratorCore is adaptive in OdeIntegrator::advance.
  • Add tests for and fix floating point comparisons.

If need be, add additional information and what the reviewer should look out for in particular:

  • Checks only whether dt changes during m_core->step calls. After only one change, register m_core as adaptive.
  • The result "m_is_adaptive" is stored in OdeIntegrator, and it is only reset (to false) whenever m_core is set.
    • This may prevent under-reporting, e.g. when advance is called repeatedly with dt == dt_max while the ODE admits a larger step size.
    • While currently not possible, this may cause over-reporting if an adaptive m_core were to be configured to be non-adaptive in between advance calls. I think this is acceptable.
  • I changed the while loop to a for loop to have the loop statement in one place. This only changes the scope of i. I you prefer the while loop for any reason, I will undo this change.
  • I spotted that floating_point_less_equal returned !floating_point_less and corrected it to !floating_point_greater.
    • This turned out to be a bit more complicated than expected, see fixes/tests in changes.
    • The number of new tests could be reduced by using a parametrised test. However, I suspect it would have marginally worse readability.

Merge Request - Guideline Checklist

Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.

Checks by code author

  • Every addressed issue is linked (use the "Closes #ISSUE" keyword below)
  • New code adheres to coding guidelines
  • No large data files have been added (files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • Tests are added for new functionality and a local test run was successful (with and without OpenMP)
  • Appropriate documentation for new functionality has been added (Doxygen in the code and Markdown files if necessary)
  • Proper attention to licenses, especially no new third-party software with conflicting license has been added
  • (For ABM development) Checked benchmark results and ran and posted a local test above from before and after development to ensure performance is monitored.

Checks by code reviewer(s)

  • Corresponding issue(s) is/are linked and addressed
  • Code is clean of development artifacts (no deactivated or commented code lines, no debugging printouts, etc.)
  • Appropriate unit tests have been added, CI passes, code coverage and performance is acceptable (did not decrease)
  • No large data files added in the whole history of commits(files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • On merge, add 2-5 lines with the changes (main added features, changed items, or corrected bugs) to the merge-commit-message. This can be taken from the briefly-list-the-changes above (best case) or the separate commit messages (worst case).

Closes #988

@codecov
Copy link

codecov bot commented Apr 9, 2024

Codecov Report

Attention: Patch coverage is 86.66667% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 96.34%. Comparing base (f5e415a) to head (14cb794).

Files Patch % Lines
cpp/memilio/math/integrator.cpp 77.77% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #996   +/-   ##
=======================================
  Coverage   96.34%   96.34%           
=======================================
  Files         129      129           
  Lines       10058    10065    +7     
=======================================
+ Hits         9690     9697    +7     
  Misses        368      368           

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

@reneSchm reneSchm requested a review from mknaranja April 10, 2024 09:05
@mknaranja mknaranja merged commit 29cf76b into main Apr 10, 2024
@mknaranja mknaranja deleted the 988-info-on-sucessful-adaptive-step-sizing-is-also-shown-for-fixed-step-size-integrators branch April 10, 2024 15:44
@mknaranja
Copy link
Member

@reneSchm Thanks for the nice fix and the additional work on float comparison operators. Good job.

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.

Info on sucessful adaptive step sizing is also shown for fixed-step-size integrators

3 participants