Skip to content

Conversation

@NicolaCourtier
Copy link
Member

@NicolaCourtier NicolaCourtier commented Dec 15, 2025

Description

Create a parent class for all types of optimisation and sampling result to clarify which attributes are shared.

Also, move PosteriorSummary attributes to the SamplingResult and deprecate the pints.AdaptiveCovarianceMCMC sampler.

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 Dec 15, 2025

Codecov Report

❌ Patch coverage is 90.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.73%. Comparing base (4628a65) to head (7359637).
⚠️ Report is 10 commits behind head on develop.

Files with missing lines Patch % Lines
pybop/_result.py 88.88% 1 Missing ⚠️
pybop/plot/contour.py 50.00% 1 Missing ⚠️
pybop/plot/convergence.py 50.00% 1 Missing ⚠️
pybop/plot/parameters.py 75.00% 1 Missing ⚠️
pybop/plot/voronoi.py 50.00% 1 Missing ⚠️
pybop/samplers/mcmc_summary.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #860      +/-   ##
===========================================
+ Coverage    89.41%   90.73%   +1.31%     
===========================================
  Files           63       67       +4     
  Lines         4857     5214     +357     
===========================================
+ Hits          4343     4731     +388     
+ Misses         514      483      -31     

☔ 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.

Copy link
Contributor

@SarahRo SarahRo left a comment

Choose a reason for hiding this comment

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

Overall this looks good to me and makes the code cleaner.

There is just one minor thing: I find it somewhat confusing where in the code the subclasses of Result are defined. OptimisationResult is defined in base_optimiser.py, but SamplingResult in mcmc_summary. Would it maybe make sense to define them in their own file?

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.

3 participants