Skip to content

Fix warnings in test suite#1569

Merged
FlorianPfaff merged 1 commit intomainfrom
copilot/check-test-case-warnings
Mar 31, 2026
Merged

Fix warnings in test suite#1569
FlorianPfaff merged 1 commit intomainfrom
copilot/check-test-case-warnings

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

49 warnings fired across the test suite, spanning production code bugs, test data issues, and unfiltered third-party noise.

Production code

  • circular_fourier_distribution.__sub__: Stop setting n post-construction; pass n=self.n directly to the constructor to avoid the ambiguous-n warning.
  • abstract_hypersphere_subset_grid_distribution.__init__: Call normalize(warn_unnorm=False) — normalization at construction time is expected, not an error. Eliminated ~3,179 repeated warnings.
  • abstract_spherical_harmonics_distribution.normalize_in_place: Added warn_unnorm=True parameter so callers can opt out of the "not normalized" warning when approximate normalization is expected.

Tests

  • test_hyperspherical_mixture.test_pdf_4d: Meshgrid included the origin (0,0,0,0), causing divide-by-zero RuntimeWarning during normalization. Filter zero-norm points before dividing.
  • Spherical harmonics tests (47 warnings): Tests using unnormalized coefficient matrices incidentally (not testing normalization) wrapped with warnings.catch_warnings(); testNormalization, which does test this behavior, updated to use assertWarns(UserWarning).
  • test_evaluation_basic: summarize_filter_results and plot_results calls use 8 runs for speed, legitimately triggering "less than 1000 runs" warnings. Suppress with catch_warnings at the call site.

Config

  • pyproject.toml: Added [tool.pytest.ini_options] filterwarnings to suppress third-party DeprecationWarnings from mpmath and bayesian_filters, and scipy.optimize.OptimizeWarning.

…ation modules

Agent-Logs-Url: https://github.com/FlorianPfaff/PyRecEst/sessions/3adcbbec-96fb-4503-915a-8f101eb5c387

Co-authored-by: FlorianPfaff <6773539+FlorianPfaff@users.noreply.github.com>
@FlorianPfaff FlorianPfaff force-pushed the copilot/check-test-case-warnings branch from 835bf61 to 8ed9e11 Compare March 31, 2026 10:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 5.97s
✅ JSON prettier 2 0 0 0 0.54s
✅ JSON v8r 2 0 0 2.59s
✅ MARKDOWN markdownlint 1 0 0 0 0.57s
✅ MARKDOWN markdown-table-formatter 1 0 0 0 0.18s
✅ PYTHON bandit 247 0 0 2.59s
✅ PYTHON black 247 1 0 0 4.01s
✅ PYTHON flake8 247 0 0 1.51s
✅ PYTHON isort 247 3 0 0 0.39s
✅ PYTHON mypy 247 0 0 3.33s
✅ PYTHON pylint 247 0 0 61.04s
✅ PYTHON ruff 247 3 0 0 0.04s
✅ REPOSITORY checkov yes no no 19.7s
✅ REPOSITORY gitleaks yes no no 3.73s
✅ REPOSITORY git_diff yes no no 0.05s
✅ REPOSITORY secretlint yes no no 6.08s
✅ REPOSITORY syft yes no no 3.52s
✅ REPOSITORY trivy-sbom yes no no 1.52s
✅ REPOSITORY trufflehog yes no no 16.61s
✅ YAML prettier 4 0 0 0 0.42s
✅ YAML v8r 4 0 0 4.81s
✅ YAML yamllint 4 0 0 0.38s

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 marked this pull request as ready for review March 31, 2026 10:42
@github-actions
Copy link
Copy Markdown
Contributor

Test Results

   12 files     12 suites   3h 7m 5s ⏱️
  514 tests   514 ✅     0 💤 0 ❌
6 380 runs  5 280 ✅ 1 100 💤 0 ❌

Results for commit 8ed9e11.

@FlorianPfaff FlorianPfaff merged commit 035ea8e into main Mar 31, 2026
20 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