Skip to content

Particle weights are now stored using the global normalization - #670

Merged
arrjon merged 24 commits into
developfrom
incrase_test_coverage
Jul 30, 2026
Merged

Particle weights are now stored using the global normalization#670
arrjon merged 24 commits into
developfrom
incrase_test_coverage

Conversation

@arrjon

@arrjon arrjon commented Jul 24, 2026

Copy link
Copy Markdown
Member

I took the chance that #668 changes the database anyway to resolve the old issue #47. Particle weights are now stored using the global normalization (weights sum to 1 across all particles of all models, matching the in-memory Population representation). This is bundled into database version 2 and handled by abc-migrate for existing databases.

Moreover, the PR cleans up some more type hints, solves some minor bugs across the codebase and adds some more tests.

@arrjon arrjon self-assigned this Jul 24, 2026
@arrjon
arrjon requested a review from kilianvolmer July 24, 2026 13:26
@codecov-commenter

codecov-commenter commented Jul 24, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 90.41096% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.46%. Comparing base (e4a09cc) to head (bee40d2).

Files with missing lines Patch % Lines
pyabc/acceptor/pdf_norm.py 33.33% 1 Missing and 1 partial ⚠️
pyabc/visualization/credible.py 0.00% 1 Missing and 1 partial ⚠️
pyabc/distance/pnorm.py 50.00% 1 Missing ⚠️
pyabc/distance/scale.py 66.66% 0 Missing and 1 partial ⚠️
pyabc/storage/history.py 85.71% 0 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #670      +/-   ##
===========================================
+ Coverage    79.26%   79.46%   +0.20%     
===========================================
  Files          142      142              
  Lines         8386     8415      +29     
  Branches      1116     1122       +6     
===========================================
+ Hits          6647     6687      +40     
+ Misses        1366     1358       -8     
+ Partials       373      370       -3     
Flag Coverage Δ
base 59.37% <53.73%> (+<0.01%) ⬆️
external-R 36.88% <16.41%> (-0.10%) ⬇️
external-other-simulators 31.50% <7.46%> (-0.15%) ⬇️
migrate 27.10% <41.09%> (+1.65%) ⬆️
petab 35.55% <14.92%> (-0.10%) ⬇️
visualization 52.68% <25.37%> (-0.31%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@arrjon

arrjon commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

Wait for #668 to be merged before

# Conflicts:
#	CHANGELOG.rst
#	pyabc/storage/migrations/versions/2_20260724_add_populations_wall_time.py
@arrjon

arrjon commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

Ready to be merged when test pass

@kilianvolmer kilianvolmer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for resolving this old issue. The changes look fine, but I would like to see a test for the database conversion. Could you please add that?

Comment thread pyabc/visualization/kde.py
Comment thread test/base/test_storage.py
@arrjon
arrjon requested a review from kilianvolmer July 29, 2026 20:02
Comment thread pyabc/storage/migrate.py Outdated
Comment thread test/migrate/test_migrate.py
@arrjon
arrjon requested a review from kilianvolmer July 30, 2026 09:15

@kilianvolmer kilianvolmer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for implementing all the changes! I think we can merge this now :)

@arrjon
arrjon merged commit eb3a02e into develop Jul 30, 2026
15 of 16 checks passed
@arrjon
arrjon deleted the incrase_test_coverage branch July 30, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants