Skip to content

save result#873

Merged
NicolaCourtier merged 13 commits intodevelopfrom
save-result
Feb 27, 2026
Merged

save result#873
NicolaCourtier merged 13 commits intodevelopfrom
save-result

Conversation

@SarahRo
Copy link
Contributor

@SarahRo SarahRo commented Jan 30, 2026

Description

Adds methods for saving result and reconstructing result from saved data. result.save: saves entire python object using pickle. result.save_data: saves primarily the logger data and any other data required to reconstruct the result from the problem or the sampler (for SamplingResult). Result.load_result: reconstructs the Result object based on the underlying problem (or sampler for SamplingResult) and the data saved to file.

Fixes #899

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #).

Important checks:

Please confirm the following before marking the PR as ready for review:

  • No style issues: $ pre-commit run or $ nox -s pre-commit (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
  • All tests pass: nox -s tests
  • The documentation builds: nox -s doctest
  • Code is commented for hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

❌ Patch coverage is 99.35484% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.91%. Comparing base (4628a65) to head (07ac36b).
⚠️ Report is 32 commits behind head on develop.

Files with missing lines Patch % Lines
pybop/plot/samples.py 97.61% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #873      +/-   ##
===========================================
+ Coverage    89.41%   92.91%   +3.49%     
===========================================
  Files           63       72       +9     
  Lines         4857     5657     +800     
===========================================
+ Hits          4343     5256     +913     
+ Misses         514      401     -113     

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

@SarahRo SarahRo marked this pull request as ready for review February 24, 2026 13:46
Copy link
Contributor

@brosaplanella brosaplanella left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks! It would be good if @NicolaCourtier or @martinjrobins can take a look before merging.

SarahRo and others added 3 commits February 24, 2026 16:38
… and define multivariate distributions in model space (#862)

* add MultivariateParameter

* fix spelling

* remove MultivariateParameters

* add MultivariateParameter to parameter_values

* improve testing and input checks

* Introduce MarginalDistribution, remove MultivariateParameter

* improve test coverage

* Use keywords for clarity

* Define multivariate distributions in model space

* add more tests and comments

* add changelog entry and adjust bounds in MultivariateUniform

* fix covariance transformation

Co-authored-by: NicolaCourtier <45851982+NicolaCourtier@users.noreply.github.com>

---------

Co-authored-by: NicolaCourtier <45851982+NicolaCourtier@users.noreply.github.com>
* Move plotting out of SamplingResult

* Load data by recreating result

* fix failing tests

* add checks to tests

---------

Co-authored-by: u2370093 <sarah.roggendorf@warwick.ac.uk>
@NicolaCourtier NicolaCourtier merged commit 5b91180 into develop Feb 27, 2026
31 checks passed
@NicolaCourtier NicolaCourtier deleted the save-result branch February 27, 2026 12:53
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.

Add save and load methods to Result

3 participants