Skip to content

Validate hypercylindrical particle filter counts - #5248

Open
FlorianPfaff wants to merge 2 commits into
mainfrom
agent/fix-hypercylindrical-particle-count-validation-20260806
Open

Validate hypercylindrical particle filter counts#5248
FlorianPfaff wants to merge 2 commits into
mainfrom
agent/fix-hypercylindrical-particle-count-validation-20260806

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Bug

HypercylindricalParticleFilter used n_particles, bound_dim, and lin_dim directly in array-shape arithmetic. Since Python and NumPy booleans are integer-like, inputs such as n_particles=True or lin_dim=False were silently interpreted as 1 or 0, constructing a filter with different dimensions instead of rejecting invalid configuration. Other malformed counts failed later with backend-specific errors.

Fix

  • validate n_particles using the established positive-count validator shared by particle filters;
  • validate bound_dim and lin_dim using the cartesian-product dimension validator;
  • reject zero total dimension before allocating state arrays.

Regression coverage

  • accept scalar NumPy integer counts;
  • reject boolean, non-scalar, fractional, negative, and zero-invalid counts;
  • reject a zero-dimensional state.

Validation

  • edited source and test files parse successfully with Python's AST parser;
  • branch is 2 commits ahead and 0 behind main;
  • full GitHub Actions matrix is authoritative.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 26.6s
✅ JSON prettier 7 0 0 0 1.12s
✅ JSON v8r 7 0 0 3.51s
✅ MARKDOWN markdownlint 68 0 0 0 1.88s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.63s
✅ PYTHON black 1865 87 0 0 90.19s
✅ PYTHON isort 1865 139 0 0 2.69s
✅ REPOSITORY betterleaks yes no no 2.66s
✅ REPOSITORY checkov yes no no 52.33s
✅ REPOSITORY gitleaks yes no no 17.28s
✅ REPOSITORY git_diff yes no no 0.31s
✅ REPOSITORY secretlint yes no no 83.2s
✅ REPOSITORY syft yes no no 5.98s
✅ REPOSITORY trivy-sbom yes no no 5.44s
✅ REPOSITORY trufflehog yes no no 32.19s
✅ YAML prettier 11 0 0 0 0.66s
✅ YAML v8r 11 0 0 10.49s
✅ YAML yamllint 11 0 0 0.55s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

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.6.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_GITLEAKS,REPOSITORY_BETTERLEAKS,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 marked this pull request as ready for review August 7, 2026 17:56
@FlorianPfaff
FlorianPfaff enabled auto-merge (squash) August 7, 2026 17:56
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