Skip to content

Fix von Mises moment inversion edge cases#2075

Merged
FlorianPfaff merged 6 commits into
mainfrom
fix/von-mises-moment-inversion
May 18, 2026
Merged

Fix von Mises moment inversion edge cases#2075
FlorianPfaff merged 6 commits into
mainfrom
fix/von-mises-moment-inversion

Conversation

@FlorianPfaff
Copy link
Copy Markdown
Owner

Summary

  • replace the unconstrained fsolve-based Bessel-ratio inverse with a bracketed scalar solve
  • validate first trigonometric moment magnitudes before moment matching
  • handle the zero-moment uniform case explicitly and reject degenerate/infeasible moments
  • add regression tests for moment reconstruction and invalid boundary values

Notes

I did not run the test suite locally in this environment. Suggested check:

python -m pytest tests/distributions/test_von_mises_distribution.py

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Test Results

    12 files  ± 0      12 suites  ±0   2h 23m 0s ⏱️ + 10m 10s
 1 838 tests + 5   1 837 ✅ + 5      1 💤 ±0  0 ❌ ±0 
22 568 runs  +60  18 004 ✅ +60  4 564 💤 ±0  0 ❌ ±0 

Results for commit 1bac057. ± Comparison against base commit 7f90866.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 17.15s
✅ JSON prettier 2 0 0 0 0.42s
✅ JSON v8r 2 0 0 2.77s
✅ MARKDOWN markdownlint 28 0 0 0 1.17s
✅ MARKDOWN markdown-table-formatter 28 0 0 0 0.32s
✅ PYTHON bandit 571 0 0 8.65s
✅ PYTHON black 571 32 0 0 17.46s
✅ PYTHON flake8 571 0 0 5.43s
✅ PYTHON isort 571 33 0 0 0.89s
✅ PYTHON mypy 571 0 0 6.54s
✅ PYTHON pylint 571 0 0 92.83s
✅ PYTHON ruff 571 33 0 0 0.12s
✅ REPOSITORY checkov yes no no 21.0s
✅ REPOSITORY gitleaks yes no no 11.96s
✅ REPOSITORY git_diff yes no no 0.05s
✅ REPOSITORY osv-scanner yes no no 0.88s
✅ REPOSITORY secretlint yes no no 9.63s
✅ REPOSITORY syft yes no no 3.27s
✅ REPOSITORY trivy-sbom yes no no 3.45s
✅ REPOSITORY trufflehog yes no no 20.72s
✅ YAML prettier 5 0 0 0 0.46s
✅ YAML v8r 5 0 0 5.24s
✅ YAML yamllint 5 0 0 0.43s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

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.5.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_OSV_SCANNER,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
Copy link
Copy Markdown
Owner Author

@copilot Fix merge conflicts

Co-authored-by: FlorianPfaff <6773539+FlorianPfaff@users.noreply.github.com>
auto-merge was automatically disabled May 18, 2026 18:39

Head branch was pushed to by a user without write access

Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

@copilot Fix merge conflicts

Merge conflicts resolved in commit 38e83a1. Kept the cleaner HEAD implementation (isfinite, _MOMENT_NORM_TOL/_BESSEL_RATIO_EDGE_TOL constants, float returns from besselratio_inverse) and combined the test files by retaining the HEAD tests plus adding test_convolution_of_uniform_components_remains_uniform from main. All 10 tests pass.

@FlorianPfaff FlorianPfaff enabled auto-merge (squash) May 18, 2026 18:46
@FlorianPfaff FlorianPfaff merged commit d48d7d5 into main May 18, 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.

2 participants