Skip to content

Reject non-finite inputs in hypertoroidal angular_error - #5459

Closed
FlorianPfaff wants to merge 2 commits into
mainfrom
fix-hypertoroidal-angular-error-nonfinite
Closed

Reject non-finite inputs in hypertoroidal angular_error#5459
FlorianPfaff wants to merge 2 commits into
mainfrom
fix-hypertoroidal-angular-error-nonfinite

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Problem

AbstractHypertoroidalDistribution.angular_error rejected NaN inputs but not +inf or -inf. Periodic reduction of infinite angles produces a non-finite result, so invalid input could silently propagate as an invalid angular error.

Fix

  • validate both angle inputs with the backend-neutral isfinite API
  • reject NaN, +inf, and -inf consistently before modulo reduction
  • add regression coverage for all three non-finite values in both alpha and beta

Testing

The regression test is backend-neutral. The repository CI matrix will exercise it under the configured NumPy, JAX, and PyTorch jobs.

@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.18s
✅ JSON prettier 7 0 0 0 0.67s
✅ JSON v8r 7 0 0 4.22s
✅ MARKDOWN markdownlint 68 0 0 0 2.04s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.37s
✅ PYTHON black 2036 1 0 0 56.49s
✅ PYTHON isort 2036 5 0 0 2.78s
✅ REPOSITORY betterleaks yes no no 1.6s
✅ REPOSITORY checkov yes no no 32.81s
✅ REPOSITORY git_diff yes no no 0.16s
✅ REPOSITORY secretlint yes no no 99.54s
✅ REPOSITORY syft yes no no 2.88s
✅ REPOSITORY trivy-sbom yes no no 2.77s
✅ YAML prettier 11 0 0 0 0.83s
✅ YAML v8r 11 0 0 16.73s
✅ YAML yamllint 11 0 0 0.94s

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

Copy link
Copy Markdown
Owner Author

Superseded by #5462. #5462 contains the same isfinite/backend-any finite-angle validation in abstract_hypertoroidal_distribution.py, carries equivalent non-finite regression coverage, and additionally fixes the default MH start point for distributions without a unique mean direction. Closing the narrower duplicate avoids conflicting edits to the same implementation hunk.

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