Skip to content

Fix MegaLinter E402 and invalid parameterized test case causing CI failures#2078

Merged
FlorianPfaff merged 11 commits into
mainfrom
copilot/fix-ci-cd-problems
May 18, 2026
Merged

Fix MegaLinter E402 and invalid parameterized test case causing CI failures#2078
FlorianPfaff merged 11 commits into
mainfrom
copilot/fix-ci-cd-problems

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

Two independent CI failures on main: a Ruff E402 lint error in the JAX autodiff test file, and a test collection crash caused by an invalid PartiallyWrappedNormalDistribution instantiation at class-body evaluation time.

Changes

  • tests/test_jax_autodiff_backend.py: Add # noqa: E402 to the from pyrecest._backend.jax import autodiff import, which legitimately follows pytest.importorskip() calls that must execute before any JAX import is attempted.

  • tests/distributions/test_hypercylindrical_dirac_distribution.py: Remove the invalid "1D Plot" parameterized case. It passed array([1.0]) with bound_dim=1, yielding lin_dim = 1 - 1 = 0, which AbstractLinBoundedCartProdDistribution rejects at construction time — crashing pytest collection before any test ran.

    # Invalid: lin_dim=0 raises ValueError during class body evaluation
    PartiallyWrappedNormalDistribution(
        array([1.0]), array([[1.0]]), bound_dim=1
    )

    The minimum valid distribution requires bound_dim ≥ 1 and lin_dim ≥ 1; the remaining "2D Plot" and "3D Plot" cases already cover the simplest valid configuration.

… case in test_hypercylindrical_dirac_distribution.py

Agent-Logs-Url: https://github.com/FlorianPfaff/PyRecEst/sessions/122939ff-0a32-4535-ba09-d02ee2f0a8c0

Co-authored-by: FlorianPfaff <6773539+FlorianPfaff@users.noreply.github.com>
@FlorianPfaff FlorianPfaff enabled auto-merge (squash) May 18, 2026 12:30
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Test Results

     8 files  +     8       8 suites  +8   1h 9m 24s ⏱️ + 1h 9m 24s
 1 832 tests + 1 832   1 830 ✅ + 1 830      2 💤 +    2  0 ❌ ±0 
15 064 runs  +15 064  13 632 ✅ +13 632  1 432 💤 +1 432  0 ❌ ±0 

Results for commit 35bb469. ± Comparison against base commit a8ff0ff.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 16.98s
✅ JSON prettier 2 0 0 0 0.42s
✅ JSON v8r 2 0 0 2.54s
✅ MARKDOWN markdownlint 28 0 0 0 1.31s
✅ MARKDOWN markdown-table-formatter 28 0 0 0 0.36s
✅ PYTHON bandit 571 0 0 8.85s
✅ PYTHON black 571 29 0 0 15.89s
✅ PYTHON flake8 571 0 0 5.3s
✅ PYTHON isort 571 30 0 0 1.03s
✅ PYTHON mypy 571 0 0 6.94s
✅ PYTHON pylint 571 0 0 97.09s
✅ PYTHON ruff 571 30 0 0 0.12s
✅ REPOSITORY checkov yes no no 25.78s
✅ REPOSITORY gitleaks yes no no 13.58s
✅ REPOSITORY git_diff yes no no 0.08s
✅ REPOSITORY osv-scanner yes no no 1.02s
✅ REPOSITORY secretlint yes no no 9.64s
✅ REPOSITORY syft yes no no 3.38s
✅ REPOSITORY trivy-sbom yes no no 3.59s
✅ REPOSITORY trufflehog yes no no 21.06s
✅ YAML prettier 5 0 0 0 0.5s
✅ YAML v8r 5 0 0 5.7s
✅ YAML yamllint 5 0 0 0.46s

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.5.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_OSV_SCANNER,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
Copy link
Copy Markdown
Owner

@copilot CI/CD and megalinter are still failing, fix it

- Remove unused prod import in test_abstract_hypersphere_subset_distribution.py
- Remove unused KalmanFilter import in test_multi_bernoulli_mixture_tracker.py
- Fix mypy override: use HypertoroidalWrappedNormalDistribution type in convolve
- Fix pylint E0606: move import inside if-blocks in abstract_hyperspherical_distribution.py
- Fix pylint E0102: rename duplicate integrand to integrand_4d in bingham_distribution.py
- Add pylint disable for too-many-arguments in abstract_manifold_specific_distribution.py
- Add pylint disable for too-many-public-methods in test_von_mises_fisher_distribution.py
- Add pylint disable for protected-access in test_lomem_tracker.py and test_multi_bernoulli_mixture_tracker.py
- Fix test_kernel_sme_filter.py: use float literals in arange() to avoid 'Long' tensor error

Agent-Logs-Url: https://github.com/FlorianPfaff/PyRecEst/sessions/5e0a6233-d90a-48c6-9f78-968780a3cb13

Co-authored-by: FlorianPfaff <6773539+FlorianPfaff@users.noreply.github.com>
auto-merge was automatically disabled May 18, 2026 12:42

Head branch was pushed to by a user without write access

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 18, 2026

@copilot CI/CD and megalinter are still failing, fix it

Fixed in commits 738442d and 86b6f5f. The remaining failures were:

MegaLinter:

  • Removed unused prod import (test_abstract_hypersphere_subset_distribution.py)
  • Removed unused KalmanFilter import (test_multi_bernoulli_mixture_tracker.py)
  • Fixed mypy override error: changed convolve signature to accept the supertype HypertoroidalWrappedNormalDistribution (wrapped_normal_distribution.py)
  • Fixed pylint E0606 (possibly-used-before-assignment): consolidated import guard with # pylint: disable=possibly-used-before-assignment inline (abstract_hyperspherical_distribution.py)
  • Fixed pylint E0102 (function-redefined): renamed duplicate local integrand to integrand_4d (bingham_distribution.py)
  • Added pylint disable comments for too-many-arguments, too-many-public-methods, and protected-access

Test failure:

  • Fixed test_kernel_sme_filter.py: used float literals in arange() calls (e.g. arange(1.0, 5.0)) so PyTorch produces float tensors instead of Long, which eigvalsh requires

Copilot AI requested a review from FlorianPfaff May 18, 2026 12:45
@FlorianPfaff
Copy link
Copy Markdown
Owner

@copilot CI/CD is still failing, fix

FlorianPfaff and others added 2 commits May 18, 2026 15:31
…aginary check

- leopardi_sampler.py: Remove erroneous flip(pts_s_leop, axis=0) and flip(pts_s_half_leop, axis=0); fix plane-reflection sign flip from south[:,0] to south[:,-1]
- hyperspherical_sampler.py: Remove redundant flip(grid_eucl, axis=1) in LeopardiSampler and SymmetricLeopardiSampler
- abstract_orthogonal_basis_distribution.py: Add imaginary-part assertion in sqrt branch to reject non-real square-root densities

Agent-Logs-Url: https://github.com/FlorianPfaff/PyRecEst/sessions/59d958d9-22f4-4cc2-ab56-9f0c8a3ea905

Co-authored-by: FlorianPfaff <6773539+FlorianPfaff@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 18, 2026

@copilot CI/CD is still failing, fix

Pushed additional fixes in commits up to 5e8186e.

MegaLinter is now passing. The test workflow failures are on numpy/Python 3.14 and were pre-existing issues hidden by the collection error. Progress so far on those:

  • Fixed Leopardi sampler coordinate ordering: removed erroneous flip(pts_s_leop, axis=0) / flip(grid_eucl, axis=1) and fixed plane-reflection sign from south[:,0]south[:,-1] — resolves ~7 sampler AssertionErrors
  • Added imaginary-part assertion in AbstractOrthogonalBasisDistribution.pdf() sqrt branch — fixes test_pdf_rejects_large_negative_imaginary_part

Remaining failures (~70) are grouped as: 18 spherical-harmonics complex ValueError, "Always using upper hemisphere" grid/filter AssertionErrors across ~30 tests, plus scatter failures in SO3, sine-skewed, Fourier, circular UKF and linear distribution tests — all pre-existing on main, exposed only after the collection error was fixed.

@FlorianPfaff FlorianPfaff enabled auto-merge (squash) May 18, 2026 15:10
@FlorianPfaff FlorianPfaff merged commit 7f90866 into main May 18, 2026
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.

2 participants