Skip to content

Wrap piecewise-constant circular matrix models - #5350

Merged
FlorianPfaff merged 2 commits into
mainfrom
fix-piecewise-circular-matrix-wrapping
Aug 18, 2026
Merged

Wrap piecewise-constant circular matrix models#5350
FlorianPfaff merged 2 commits into
mainfrom
fix-piecewise-circular-matrix-wrapping

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

  • wrap numerical system-model outputs modulo 2*pi before assigning them to state intervals
  • wrap numerical measurement-model outputs modulo 2*pi before assigning them to measurement intervals
  • add focused regressions using additive circular models with uniform noise

Bug

PiecewiseConstantFilter.calculate_system_matrix_numerically() and calculate_measurement_matrix_numerically() integrated the raw outputs of a(x, w) and h(x, v) against intervals in [0, 2*pi). For natural additive circular models such as x + w, outputs above 2*pi were therefore outside every interval and their probability mass was silently discarded. The resulting transition or measurement matrix could have columns whose total probability was substantially below one.

Fix

Normalize the model output with the backend mod(..., 2*pi) operation before the interval-membership test. Callers that already return wrapped angles are unaffected; unwrapped additive models now preserve circular probability mass.

Validation

  • branch is based directly on fc15bed910b324cd0619a2f2b71abc887bc09747 (main) and is 2 commits ahead / 0 behind
  • production diff is limited to three replacements in piecewise_constant_filter.py
  • NumPy regressions require the 2-bin transition and measurement matrices for uniform additive circular noise to be 0.5 in every entry and to have unit column sums
  • full backend/test validation is delegated to GitHub Actions because this execution environment cannot clone the repository over the network

@github-actions

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 5.95s
✅ JSON prettier 7 0 0 0 0.59s
✅ JSON v8r 7 0 0 3.12s
✅ MARKDOWN markdownlint 68 0 0 0 2.4s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.37s
✅ PYTHON black 1984 10 0 0 56.2s
✅ PYTHON isort 1984 21 0 0 2.43s
✅ REPOSITORY betterleaks yes no no 1.56s
✅ REPOSITORY checkov yes no no 34.62s
✅ REPOSITORY git_diff yes no no 0.16s
✅ REPOSITORY secretlint yes no no 87.39s
✅ REPOSITORY syft yes no no 2.61s
✅ REPOSITORY trivy-sbom yes no no 1.89s
✅ YAML prettier 11 0 0 0 0.74s
✅ YAML v8r 11 0 0 9.24s
✅ YAML yamllint 11 0 0 1.05s

Notices

⚠️ Your configuration references items that have been removed from MegaLinter and are ignored: MAKEFILE_CHECKMAKE. See Removed linters to find their replacements.

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@10.0.0 --custom-flavor-setup --custom-flavor-linters PYTHON_BLACK,PYTHON_ISORT,COPYPASTE_JSCPD,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY_SBOM,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

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

@FlorianPfaff
FlorianPfaff marked this pull request as ready for review August 18, 2026 19:19
@FlorianPfaff
FlorianPfaff merged commit c02365e into main Aug 18, 2026
13 of 24 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