Skip to content

Define LogPrior, LogPDF, LogPosterior and update set_target#897

Open
NicolaCourtier wants to merge 58 commits intodevelopfrom
define-log-prior
Open

Define LogPrior, LogPDF, LogPosterior and update set_target#897
NicolaCourtier wants to merge 58 commits intodevelopfrom
define-log-prior

Conversation

@NicolaCourtier
Copy link
Member

Description

Adds separate LogPrior, LogPDF and LogPosterior classes to re-enable the comparison via plotting in the maximum_a_posteriori.ipynb example and to clarify that samplers are only appropriate for LogPDF-type problems. Also updates the set_target attribute of costs and problems.

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 26, 2026

Codecov Report

❌ Patch coverage is 95.16129% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.84%. Comparing base (4628a65) to head (28a1479).
⚠️ Report is 33 commits behind head on develop.

Files with missing lines Patch % Lines
pybop/problems/meta_problem.py 66.66% 3 Missing ⚠️
pybop/costs/base_cost.py 95.00% 2 Missing ⚠️
pybop/problems/log_pdf.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #897      +/-   ##
===========================================
+ Coverage    89.41%   92.84%   +3.42%     
===========================================
  Files           63       73      +10     
  Lines         4857     5674     +817     
===========================================
+ Hits          4343     5268     +925     
+ Misses         514      406     -108     

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

@NicolaCourtier NicolaCourtier changed the base branch from fix-parameter-assignment to develop February 27, 2026 14:33
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