Skip to content

Add SO3 uniform distribution#1913

Merged
FlorianPfaff merged 8 commits intomainfrom
codex/so3-uniform-distribution
Apr 29, 2026
Merged

Add SO3 uniform distribution#1913
FlorianPfaff merged 8 commits intomainfrom
codex/so3-uniform-distribution

Conversation

@FlorianPfaff
Copy link
Copy Markdown
Owner

Summary

  • Add SO3UniformDistribution for Haar-uniform rotations represented as scalar-last unit quaternions (x, y, z, w) on the canonical upper S^3 hemisphere.
  • Provide constant pdf/ln_pdf, backend-compatible canonical sampling, SO(3) geodesic distance, quaternion-to-rotation-matrix conversion, and explicit unavailable mean/mode behavior.
  • Export the new distribution and add focused tests for inheritance, density, sampling, distance, rotation matrices, and undefined mean/mode access.

Validation

  • python -m unittest tests.distributions.test_so3_uniform_distribution
  • $env:PYRECEST_BACKEND='numpy'; python -m pytest -q tests/distributions/test_so3_uniform_distribution.py
  • $env:PYRECEST_BACKEND='jax'; python -m pytest -q tests/distributions/test_so3_uniform_distribution.py
  • $env:PYRECEST_BACKEND='pytorch'; python -m pytest -q tests/distributions/test_so3_uniform_distribution.py
  • python -m unittest tests.distributions.test_so3_uniform_distribution tests.distributions.test_hyperspherical_uniform_distribution
  • python -m black --check src/pyrecest/distributions/so3_uniform_distribution.py tests/distributions/test_so3_uniform_distribution.py
  • python -m ruff check src/pyrecest/distributions/so3_uniform_distribution.py tests/distributions/test_so3_uniform_distribution.py src/pyrecest/distributions/__init__.py
  • python -m pylint src/pyrecest/distributions/so3_uniform_distribution.py tests/distributions/test_so3_uniform_distribution.py
  • python -m mypy --ignore-missing-imports src/pyrecest/distributions/so3_uniform_distribution.py tests/distributions/test_so3_uniform_distribution.py

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 14.62s
✅ JSON prettier 2 0 0 0 0.44s
✅ JSON v8r 2 0 0 2.37s
✅ MARKDOWN markdownlint 21 0 0 0 1.17s
✅ MARKDOWN markdown-table-formatter 21 0 0 0 0.35s
✅ PYTHON bandit 437 0 0 6.83s
✅ PYTHON black 437 0 0 0 10.41s
✅ PYTHON flake8 437 0 0 3.87s
✅ PYTHON isort 437 0 0 0 0.83s
✅ PYTHON mypy 437 0 0 5.8s
✅ PYTHON pylint 437 0 0 138.9s
✅ PYTHON ruff 437 0 0 0 0.08s
✅ REPOSITORY checkov yes no no 24.84s
✅ REPOSITORY gitleaks yes no no 8.15s
✅ REPOSITORY git_diff yes no no 0.07s
✅ REPOSITORY secretlint yes no no 8.21s
✅ REPOSITORY syft yes no no 6.64s
✅ REPOSITORY trivy-sbom yes no no 3.7s
✅ REPOSITORY trufflehog yes no no 20.28s
✅ YAML prettier 5 0 0 0 0.54s
✅ YAML v8r 5 0 0 5.28s
✅ YAML yamllint 5 0 0 0.54s

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.4.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_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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

Test Results

    12 files  +    12      12 suites  +12   4h 6m 14s ⏱️ + 4h 6m 14s
 1 233 tests + 1 233   1 233 ✅ + 1 233      0 💤 ±    0  0 ❌ ±0 
15 160 runs  +15 160  11 624 ✅ +11 624  3 536 💤 +3 536  0 ❌ ±0 

Results for commit 817e6f9. ± Comparison against base commit ddae39b.

♻️ This comment has been updated with latest results.

@FlorianPfaff FlorianPfaff marked this pull request as ready for review April 28, 2026 17:55
@FlorianPfaff FlorianPfaff enabled auto-merge (squash) April 29, 2026 01:07
@FlorianPfaff FlorianPfaff merged commit 6202bfa into main Apr 29, 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.

1 participant