Skip to content

Restore sparse transition state-shape validation - #5460

Merged
FlorianPfaff merged 2 commits into
mainfrom
codex/restore-sparse-transition-validation
Aug 30, 2026
Merged

Restore sparse transition state-shape validation#5460
FlorianPfaff merged 2 commits into
mainfrom
codex/restore-sparse-transition-validation

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

  • restore the public compatibility wrapper's 1-D/2-D state-vector shape validation
  • reject empty state sets and zero-coordinate states before transition construction
  • preserve the validation behavior of the underlying discrete_state.py implementation
  • add regression coverage for scalar, >2-D, empty, and zero-coordinate inputs

Bug

pyrecest.filters.discrete_state.sparse_gaussian_transition_matrix is exported through the compatibility package wrapper, which reimplements the transition construction for improved numerical stability. That wrapper omitted structural checks present in the underlying implementation. As a result, malformed inputs could fail with downstream IndexError/NumPy errors or reach invalid transition construction instead of raising the documented ValueError at the API boundary.

Tests

Added tests/filters/test_sparse_gaussian_transition_validation.py covering the four missing validation cases.

@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 7.52s
✅ JSON prettier 7 0 0 0 0.71s
✅ JSON v8r 7 0 0 4.39s
✅ MARKDOWN markdownlint 68 0 0 0 2.2s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.51s
✅ PYTHON black 2036 1 0 0 58.64s
✅ PYTHON isort 2036 5 0 0 2.83s
✅ REPOSITORY betterleaks yes no no 1.56s
✅ REPOSITORY checkov yes no no 35.24s
✅ REPOSITORY git_diff yes no no 0.14s
✅ REPOSITORY secretlint yes no no 103.8s
✅ REPOSITORY syft yes no no 2.92s
✅ REPOSITORY trivy-sbom yes no no 2.58s
✅ YAML prettier 11 0 0 0 0.7s
✅ YAML v8r 11 0 0 18.06s
✅ YAML yamllint 11 0 0 0.85s

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 d5ee7c8 into main Aug 30, 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