Add better time tracking - #668
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #668 +/- ##
===========================================
+ Coverage 79.21% 79.28% +0.07%
===========================================
Files 141 142 +1
Lines 8337 8386 +49
Branches 1111 1116 +5
===========================================
+ Hits 6604 6649 +45
- Misses 1362 1365 +3
- Partials 371 372 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR improves time tracking in pyABC by (1) persisting per-generation walltime in the database to make walltime visualizations accurate across resumed runs, and (2) adding fine-grained per-generation execution-time profiling inside the ABC-SMC loop.
Changes:
- Store per-population walltime (
Population.wall_time) in the DB and use it inplot_walltime/plot_total_walltimeto avoid counting idle resume gaps. - Add per-generation execution-time profiling in
ABCSMC.run_generation(pipeline setup, simulation, in-between steps) and return these timings to callers. - Add a regression test for “resume gap” walltime plotting; bump package + DB versions and document in the changelog.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/visualization/test_base_viz.py | Adds a regression test ensuring resume gaps don’t inflate plotted walltime when per-generation walltimes exist. |
| pyabc/visualization/walltime.py | Uses per-generation wall_time when available for walltime plots; adds low-level support for passing walltimes. |
| pyabc/version.py | Bumps package version to 0.12.19. |
| pyabc/storage/version.py | Bumps DB version to 2. |
| pyabc/storage/history.py | Extends population queries and storage updates to include wall_time; threads walltime through calibration/population storage. |
| pyabc/storage/db_model.py | Adds wall_time column to the populations table model. |
| pyabc/inference/smc.py | Adds _Timer and per-generation profiling; stores per-generation walltime in the DB; returns timing data from run_generation. |
| pyabc/distance/pnorm.py | Type-hint refinements (Optional/None unions). |
| pyabc/distance/base.py | Type-hint refinements; tightens FunctionDistance typing and allows None in to_distance input typing. |
| CHANGELOG.rst | Documents new profiling, walltime plotting behavior, and DB format change for 0.12.19. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kilianvolmer
left a comment
There was a problem hiding this comment.
Thank you for implementing all those changes so fast! I left a few minor comments here and there, nothing severe.
# Conflicts: # pyabc/distance/pnorm.py # pyabc/inference/smc.py # pyabc/visualization/walltime.py
|
Ready to merge now |
This pull request adds detailed execution time profiling to the ABC-SMC run, including both wall-clock and fine-grained sub-step timings. Additionally, per-generation walltimes are now stored in the database, and visualizations have been updated to reflect these more accurate timings.
I also cleaned up some minor code.
Resolves #325 and #667