[Pylib] Add utility to run simulations using callbacks & auto checkpointing#1874
Conversation
|
Thanks @tdavidcl for opening this PR! You can do multiple things directly here: Once the workflow completes a message will appear displaying informations related to the run. Also the PR gets automatically reviewed by gemini, you can: |
There was a problem hiding this comment.
Code Review
This pull request introduces walltime and global walltime limits to the SPH solver's evolve_until method, allowing simulations to stop gracefully when limits are reached. The implementation dynamically calculates the next check interval to minimize overhead. Feedback focuses on preventing undefined behavior in C++: first, by adding a bounds check before casting floating-point remaining iterations to an integer; and second, by performing a safe addition when calculating the next check iteration to prevent signed integer overflow.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
evolve_until according to walltime|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new SimulationRunner utility class to structure simulation runs using setup and callback decorators, and refactors the circular disc sink example to use this new framework. The review feedback highlights several critical improvements for SimulationRunner.py, including fixing validation logic in SimulationRunner (since __post_init__ is not called on non-dataclasses), handling None values for next_walltime to avoid pybind11 type errors, refactoring CallbackState to be a standard Python class instead of a broken dataclass, and adding a small tolerance to floating-point time comparisons to prevent missed callback triggers.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Workflow reportworkflow report corresponding to commit c1eab20 Pre-commit check reportPre-commit check: ✅ Test pipeline can run. Clang-tidy diff reportDoxygen diff with
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
No description provided.