Skip to content

[codex] Fix Dirac distribution mode selection#1838

Merged
FlorianPfaff merged 2 commits intomainfrom
codex/fix-dirac-mode
Apr 25, 2026
Merged

[codex] Fix Dirac distribution mode selection#1838
FlorianPfaff merged 2 commits intomainfrom
codex/fix-dirac-mode

Conversation

@FlorianPfaff
Copy link
Copy Markdown
Owner

Summary

  • Fix AbstractDiracDistribution.mode() to select the maximum-weight Dirac with backend argmax instead of unpacking max(self.w).
  • Return the selected Dirac location directly so the method works for row-shaped and one-dimensional sample arrays.
  • Correct the equally-weighted warning check to compare the maximum weight against the uniform-weight baseline.
  • Add a regression test covering a weighted Dirac distribution whose mode should be the highest-weighted sample without warnings.

Validation

  • Not run locally; this session has a read-only filesystem, so the change was made through the GitHub connector. CI should run on the PR.

@FlorianPfaff FlorianPfaff marked this pull request as ready for review April 25, 2026 07:42
@github-actions
Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 14.02s
✅ JSON prettier 2 0 0 0 0.53s
✅ JSON v8r 2 0 0 2.54s
✅ MARKDOWN markdownlint 2 0 0 0 0.65s
✅ MARKDOWN markdown-table-formatter 2 0 0 0 0.25s
✅ PYTHON bandit 382 0 0 5.38s
✅ PYTHON black 382 33 0 0 9.34s
✅ PYTHON flake8 382 0 0 2.87s
✅ PYTHON isort 382 36 0 0 0.73s
✅ PYTHON mypy 382 0 0 4.76s
✅ PYTHON pylint 382 0 0 111.35s
✅ PYTHON ruff 382 36 0 0 0.08s
✅ REPOSITORY checkov yes no no 21.05s
✅ REPOSITORY gitleaks yes no no 9.78s
✅ REPOSITORY git_diff yes no no 0.06s
✅ REPOSITORY secretlint yes no no 7.37s
✅ REPOSITORY syft yes no no 3.39s
✅ REPOSITORY trivy-sbom yes no no 1.94s
✅ REPOSITORY trufflehog yes no no 18.73s
✅ YAML prettier 4 0 0 0 0.44s
✅ YAML v8r 4 0 0 5.51s
✅ YAML yamllint 4 0 0 0.39s

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

Test Results

    12 files  +    4      12 suites  +4   4h 32m 23s ⏱️ + 2h 46m 43s
 1 097 tests +    7   1 097 ✅ +    7      0 💤 ±  0  0 ❌ ±0 
13 448 runs  +4 516  10 356 ✅ +3 752  3 092 💤 +764  0 ❌ ±0 

Results for commit ba5837d. ± Comparison against base commit 24543a9.

@FlorianPfaff FlorianPfaff merged commit 7fa7e8e into main Apr 25, 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