Skip to content

Fix hypertoroidal Dirac marginalization typing#2058

Merged
FlorianPfaff merged 1 commit into
mainfrom
codex/fix-hypertoroidal-dirac-mypy
May 16, 2026
Merged

Fix hypertoroidal Dirac marginalization typing#2058
FlorianPfaff merged 1 commit into
mainfrom
codex/fix-hypertoroidal-dirac-mypy

Conversation

@FlorianPfaff
Copy link
Copy Markdown
Owner

Summary

  • Replaces exception-based normalization in HypertoroidalDiracDistribution.marginalize_out with explicit int vs list type narrowing.
  • Keeps existing runtime behavior while allowing mypy to infer that the normalized dimensions are list[int].

Validation

  • PYTHONPATH=src python -m pytest tests\distributions\test_hypertoroidal_dirac_marginalize_out.py tests\distributions\test_hypertoroidal_dirac_distribution.py -q
  • PYTHONPATH=src python -m mypy --ignore-missing-imports --follow-imports=skip src\pyrecest\distributions\hypertorus\hypertoroidal_dirac_distribution.py
  • python -m ruff check src\pyrecest\distributions\hypertorus\hypertoroidal_dirac_distribution.py tests\distributions\test_hypertoroidal_dirac_marginalize_out.py tests\distributions\test_hypertoroidal_dirac_distribution.py
  • python -m black --check src\pyrecest\distributions\hypertorus\hypertoroidal_dirac_distribution.py tests\distributions\test_hypertoroidal_dirac_marginalize_out.py tests\distributions\test_hypertoroidal_dirac_distribution.py
  • python -m isort --check-only --profile black src\pyrecest\distributions\hypertorus\hypertoroidal_dirac_distribution.py
  • python -m pylint src\pyrecest\distributions\hypertorus\hypertoroidal_dirac_distribution.py
  • git diff --check

@github-actions
Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 22.64s
✅ JSON prettier 2 0 0 0 0.47s
✅ JSON v8r 2 0 0 2.66s
✅ MARKDOWN markdownlint 28 0 0 0 1.37s
✅ MARKDOWN markdown-table-formatter 28 0 0 0 0.32s
✅ PYTHON bandit 551 0 0 9.25s
✅ PYTHON black 551 0 0 0 14.54s
✅ PYTHON flake8 551 0 0 5.3s
✅ PYTHON isort 551 1 0 0 1.03s
✅ PYTHON mypy 551 0 0 7.02s
✅ PYTHON pylint 551 0 0 128.48s
✅ PYTHON ruff 551 1 0 0 0.1s
✅ REPOSITORY checkov yes no no 29.99s
✅ REPOSITORY gitleaks yes no no 10.8s
✅ REPOSITORY git_diff yes no no 0.03s
✅ REPOSITORY secretlint yes no no 9.8s
✅ REPOSITORY syft yes no no 3.17s
✅ REPOSITORY trivy-sbom yes no no 3.72s
✅ REPOSITORY trufflehog yes no no 22.71s
✅ YAML prettier 5 0 0 0 0.53s
✅ YAML v8r 5 0 0 5.04s
✅ YAML yamllint 5 0 0 0.5s

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

@FlorianPfaff FlorianPfaff merged commit 2532542 into main May 16, 2026
14 of 18 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