Skip to content

Add data-file chain support to SamplingResult - #987

Closed
Fstarnb wants to merge 3 commits into
pybop-team:developfrom
Fstarnb:fix/898-sampling-result-chains
Closed

Fstarnb wants to merge 3 commits into
pybop-team:developfrom
Fstarnb:fix/898-sampling-result-chains

Conversation

@Fstarnb

@Fstarnb Fstarnb commented Oct 13, 2026 •

Copy link
Copy Markdown

Summary

  • Add serialization and loading for retained SamplingResult chains in JSON, MATLAB, and pickle files.
  • Preserve the exact retained-chain shape, including zero retained iterations.
  • Reject malformed shape metadata and report clearly when legacy files lack chain data.

Fixes #898.

Validation

  • pytest tests/unit/test_sampling.py --unit -q — 88 passed
  • ruff check pybop/_result.py pybop/samplers/base_sampler.py tests/unit/test_sampling.py
  • ruff format --check pybop/_result.py pybop/samplers/base_sampler.py tests/unit/test_sampling.py
  • python -m py_compile pybop/samplers/base_sampler.py tests/unit/test_sampling.py
  • git diff --check

Fstarnb added a commit to Fstarnb/PyBOP that referenced this pull request Oct 13, 2026
@Fstarnb
Fstarnb marked this pull request as ready for review October 13, 2026 11:04
@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.94%. Comparing base (3171a07) to head (5889a25).
⚠️ Report is 19 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #987      +/-   ##
===========================================
+ Coverage    92.13%   92.94%   +0.80%     
===========================================
  Files           74       84      +10     
  Lines         5799     6818    +1019     
===========================================
+ Hits          5343     6337     +994     
- Misses         456      481      +25     

☔ View full report in Codecov by Harness.
📢 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.

@Fstarnb
Fstarnb force-pushed the fix/898-sampling-result-chains branch from 560f7d5 to 5889a25 Compare October 14, 2026 13:28
@Fstarnb Fstarnb closed this Oct 14, 2026
@Fstarnb Fstarnb mentioned this pull request Oct 14, 2026
1 task done
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.

Reconstruct chains for SamplingResult

1 participant