Skip to content

Add configurable particle resampling#1978

Merged
FlorianPfaff merged 2 commits into
mainfrom
codex/configurable-particle-resampling
May 7, 2026
Merged

Add configurable particle resampling#1978
FlorianPfaff merged 2 commits into
mainfrom
codex/configurable-particle-resampling

Conversation

@FlorianPfaff
Copy link
Copy Markdown
Owner

Summary

  • Adds a configurable resampling_criterion to AbstractParticleFilter.
  • Preserves the historical behavior by treating None as "always resample after update".
  • Adds public resample(), should_resample(), resample_if_needed(), and set_resampling_criterion(...) helpers.
  • Switches the generic likelihood update path from unconditional post-update resampling to criterion-driven resampling.
  • Adds Euclidean particle-filter regression tests for skipped automatic resampling and manual resampling.

Notes

The main generic particle-filter update path now supports weighted posteriors after updates when users set, for example, pf.set_resampling_criterion(lambda state: False). Manual resampling remains available via pf.resample().

Validation

  • Not run locally in this environment; CI should exercise the changed tests.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 16.08s
✅ JSON prettier 2 0 0 0 0.64s
✅ JSON v8r 2 0 0 3.06s
✅ MARKDOWN markdownlint 28 0 0 0 1.1s
✅ MARKDOWN markdown-table-formatter 28 0 0 0 0.24s
✅ PYTHON bandit 488 0 0 6.72s
✅ PYTHON black 488 1 0 0 11.24s
✅ PYTHON flake8 488 0 0 3.93s
✅ PYTHON isort 488 1 0 0 0.76s
✅ PYTHON mypy 488 0 0 5.23s
✅ PYTHON pylint 488 0 0 96.16s
✅ PYTHON ruff 488 1 0 0 0.08s
✅ REPOSITORY checkov yes no no 18.02s
✅ REPOSITORY gitleaks yes no no 11.64s
✅ REPOSITORY git_diff yes no no 0.06s
✅ REPOSITORY secretlint yes no no 8.79s
✅ REPOSITORY syft yes no no 3.17s
✅ REPOSITORY trivy-sbom yes no no 3.4s
✅ REPOSITORY trufflehog yes no no 19.3s
✅ YAML prettier 5 0 0 0 0.45s
✅ YAML v8r 5 0 0 5.76s
✅ YAML yamllint 5 0 0 0.38s

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.4.0 --custom-flavor-setup --custom-flavor-linters PYTHON_PYLINT,PYTHON_BLACK,PYTHON_FLAKE8,PYTHON_ISORT,PYTHON_BANDIT,PYTHON_MYPY,PYTHON_RUFF,COPYPASTE_JSCPD,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@FlorianPfaff FlorianPfaff enabled auto-merge (squash) May 7, 2026 09:20
@FlorianPfaff FlorianPfaff merged commit 92a127b into main May 7, 2026
19 checks passed
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.

1 participant