Skip to content

Update the samplers to align saving of result#896

Merged
NicolaCourtier merged 4 commits intosave-resultfrom
save-result-2
Feb 27, 2026
Merged

Update the samplers to align saving of result#896
NicolaCourtier merged 4 commits intosave-resultfrom
save-result-2

Conversation

@NicolaCourtier
Copy link
Member

Description

Move the plotting out of the Sampler class. Add result.load and update result.load_data to recreate a Result object.

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 Feb 27, 2026

Codecov Report

❌ Patch coverage is 98.55072% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.63%. Comparing base (a43d72c) to head (b6a3e98).
⚠️ Report is 1 commits behind head on save-result.

Files with missing lines Patch % Lines
pybop/plot/samples.py 97.61% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           save-result     #896      +/-   ##
===============================================
- Coverage        92.67%   92.63%   -0.05%     
===============================================
  Files               71       72       +1     
  Lines             5639     5619      -20     
===============================================
- Hits              5226     5205      -21     
- Misses             413      414       +1     

☔ 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 27, 2026 11:12
@NicolaCourtier NicolaCourtier merged commit 358e773 into save-result Feb 27, 2026
31 checks passed
@NicolaCourtier NicolaCourtier deleted the save-result-2 branch February 27, 2026 12:29
NicolaCourtier added a commit that referenced this pull request Feb 27, 2026
* save result

* improve test coverage

* save appropriate data in save_data method

* style: pre-commit fixes

* update changelog

* improve test coverage

* Allow multivariate parameters to be passed via pybamm.ParameterValues 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>

* Update the samplers to align saving of result (#896)

* 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>

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: NicolaCourtier <45851982+NicolaCourtier@users.noreply.github.com>
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