Skip to content

Add HDF5 checkpoint support for analysis pipeline Add support f…#18

Draft
darshanmandge wants to merge 2 commits into
mainfrom
feature/hdf5-checkpoint-support
Draft

Add HDF5 checkpoint support for analysis pipeline Add support f…#18
darshanmandge wants to merge 2 commits into
mainfrom
feature/hdf5-checkpoint-support

Conversation

@darshanmandge

Copy link
Copy Markdown
Collaborator

No description provided.

…or reading optimisation checkpoints from HDF5 files in addition to pickle. This enables storing portable, reproducible checkpoint summaries that are not tied to specific Python/library versions. Changes: - New module bluepyemodel/tools/checkpoint_hdf5.py with: - read_checkpoint_h5(): reads HDF5 and returns DEAP-compatible shims - convert_checkpoint(): pickle → HDF5 conversion utility - Shim classes (_Individual, _Logbook, _CMAStatus, _History) that implement the exact API surface used by the analysis pipeline - Updated read_checkpoint() in utils.py to auto-detect format (.h5/.pkl) - Updated existing_checkpoint_paths() to glob both .pkl and .h5 - Updated access_point.py to use read_checkpoint() instead of inline pickle.load, and to discover .h5 checkpoint files HDF5 layout stores: param_names, halloffame (genes+fitness), population (genes+fitness), logbook (per-gen stats), and history/genealogy_genes for parameter evolution plots. Tested end-to-end: store_optimisation_results, optimisation plot, evolution_parameters_density, and check_optimisation_state all work from HDF5 with pickle removed.
@darshanmandge darshanmandge self-assigned this Jun 27, 2026
@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 21.64948% with 152 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
bluepyemodel/tools/checkpoint_hdf5.py 21.08% 146 Missing ⚠️
bluepyemodel/tools/utils.py 42.85% 4 Missing ⚠️
bluepyemodel/access_point/access_point.py 0.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
bluepyemodel/access_point/access_point.py 36.02% <0.00%> (ø)
bluepyemodel/tools/utils.py 18.01% <42.85%> (ø)
bluepyemodel/tools/checkpoint_hdf5.py 21.08% <21.08%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread bluepyemodel/tools/utils.py Outdated
p = Path(checkpoint_path)

# HDF5 format
if p.suffix in (".h5", ".hdf5"):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If you write .h5 it won't become .hdf5, no? Wouldn't checking only for .h5 be sufficient?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Comment thread bluepyemodel/tools/checkpoint_hdf5.py
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.

2 participants