Skip to content

Reject extra integration-bound rows for 1-D hypertori - #5458

Merged
FlorianPfaff merged 2 commits into
mainfrom
fix-hypertoroidal-1d-integration-boundary-count
Aug 28, 2026
Merged

Reject extra integration-bound rows for 1-D hypertori#5458
FlorianPfaff merged 2 commits into
mainfrom
fix-hypertoroidal-1d-integration-boundary-count

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Bug

AbstractHypertoroidalDistribution.integrate_numerically() uses

if self.dim not in (1, integration_boundaries.shape[0]):

After atleast_2d, that condition can never reject an incorrect row count when self.dim == 1. A 1-D circular distribution therefore accepts two or more integration-bound rows and forwards them to scipy.integrate.nquad, which turns the call into a higher-dimensional integral and can feed malformed points to the PDF instead of raising the documented boundary-count error.

Fix

Require the normalized boundary row count to equal self.dim unconditionally. This preserves the supported 1-D shorthand [lower, upper], because atleast_2d normalizes it to shape (1, 2).

Regression coverage

Adds a NumPy-only regression using WrappedNormalDistribution that verifies a 1-D distribution rejects two boundary rows with the existing one row per dimension error.

Scope

  • one production-line change
  • one focused regression test
  • branch based on main at c4a857e6f84288397a186ff75849f0d0e7dfbaba

Local repository execution was not available in this environment; GitHub Actions is the authoritative validation.

@FlorianPfaff
FlorianPfaff enabled auto-merge (squash) August 28, 2026 19:52
@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.49s
✅ JSON prettier 7 0 0 0 0.5s
✅ JSON v8r 7 0 0 3.45s
✅ MARKDOWN markdownlint 68 0 0 0 1.96s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.3s
✅ PYTHON black 2035 1 0 0 47.29s
✅ PYTHON isort 2035 4 0 0 2.14s
✅ REPOSITORY betterleaks yes no no 1.45s
✅ REPOSITORY checkov yes no no 26.63s
✅ REPOSITORY git_diff yes no no 0.08s
✅ REPOSITORY secretlint yes no no 77.85s
✅ REPOSITORY syft yes no no 2.32s
✅ REPOSITORY trivy-sbom yes no no 1.91s
✅ YAML prettier 11 0 0 0 0.63s
✅ YAML v8r 11 0 0 13.01s
✅ YAML yamllint 11 0 0 0.6s

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 d13e2b0 into main Aug 28, 2026
26 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