Skip to content

Respect custom hyperspherical distance integration bounds - #5456

Merged
FlorianPfaff merged 3 commits into
mainfrom
fix/hypersphere-distance-boundaries
Aug 28, 2026
Merged

Respect custom hyperspherical distance integration bounds#5456
FlorianPfaff merged 3 commits into
mainfrom
fix/hypersphere-distance-boundaries

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Bug

AbstractHypersphereSubsetDistribution.hellinger_distance_numerical() and total_variation_distance_numerical() accepted an integration_boundaries argument and even filled in the subclass-specific full-domain default, but then discarded that value and called integrate_fun_over_domain(). Consequently, callers asking for a distance integral over a subset of the hypersphere silently received the full-domain distance instead.

Fix

Route both distance integrands through integrate_fun_over_domain_part(..., integration_boundaries), matching integrate_numerically() and preserving the existing full-domain behavior when no custom bounds are supplied.

Regression

Add two non-identical S1 von Mises-Fisher distributions and verify, for both Hellinger and total-variation distance, that a strict positive-length angular subset gives a positive distance that is strictly smaller than the full-circle distance. On current main, the partial and full values are identical because the supplied bounds are ignored.

JAX skips the numerical integration regression consistently with the existing SciPy-based hyperspherical integration limitation.

@FlorianPfaff
FlorianPfaff enabled auto-merge (squash) August 28, 2026 19:26
@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 8.07s
✅ JSON prettier 7 0 0 0 0.84s
✅ JSON v8r 7 0 0 4.26s
✅ MARKDOWN markdownlint 68 0 0 0 2.19s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.44s
✅ PYTHON black 2033 1 0 0 65.62s
✅ PYTHON isort 2033 4 0 0 2.94s
✅ REPOSITORY betterleaks yes no no 1.49s
✅ REPOSITORY checkov yes no no 35.0s
✅ REPOSITORY git_diff yes no no 0.28s
✅ REPOSITORY secretlint yes no no 107.04s
✅ REPOSITORY syft yes no no 2.85s
✅ REPOSITORY trivy-sbom yes no no 2.82s
✅ YAML prettier 11 0 0 0 1.06s
✅ YAML v8r 11 0 0 17.17s
✅ YAML yamllint 11 0 0 1.0s

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 merged commit c4a857e into main Aug 28, 2026
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