Skip to content

Porting ToroidalVMCosineDistribution code#1607

Open
Copilot wants to merge 4 commits intomainfrom
copilot/port-toroidal-vm-cosine-distribution
Open

Porting ToroidalVMCosineDistribution code#1607
Copilot wants to merge 4 commits intomainfrom
copilot/port-toroidal-vm-cosine-distribution

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

Pull request created by AI Agent

Agent-Logs-Url: https://github.com/FlorianPfaff/PyRecEst/sessions/a6fbc6c8-a141-4bd2-a54c-833a26347f70

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

github-actions bot commented Apr 1, 2026

MegaLinter analysis: Error

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 9.91s
✅ JSON prettier 2 0 0 0 0.51s
✅ JSON v8r 2 0 0 2.68s
✅ MARKDOWN markdownlint 1 0 0 0 0.64s
✅ MARKDOWN markdown-table-formatter 1 0 0 0 0.25s
✅ PYTHON bandit 259 0 0 3.28s
✅ PYTHON black 259 2 0 0 4.61s
✅ PYTHON flake8 259 0 0 1.82s
✅ PYTHON isort 259 2 0 0 0.51s
✅ PYTHON mypy 259 0 0 4.07s
❌ PYTHON pylint 259 1 0 75.27s
✅ PYTHON ruff 259 2 0 0 0.05s
✅ REPOSITORY checkov yes no no 21.73s
✅ REPOSITORY gitleaks yes no no 4.49s
✅ REPOSITORY git_diff yes no no 0.02s
✅ REPOSITORY secretlint yes no no 6.31s
✅ REPOSITORY syft yes no no 3.95s
✅ REPOSITORY trivy-sbom yes no no 1.59s
✅ REPOSITORY trufflehog yes no no 18.21s
✅ YAML prettier 4 0 0 0 0.5s
✅ YAML v8r 4 0 0 5.05s
✅ YAML yamllint 4 0 0 0.44s

Detailed Issues

❌ PYTHON / pylint - 1 error
************* Module update_init_helper
update_init_helper.py:1:0: R0801: Similar lines in 2 files
==pyrecest.distributions.hypertorus.toroidal_von_mises_cosine_distribution:[48:55]
==pyrecest.distributions.hypertorus.toroidal_von_mises_sine_distribution:[33:40]
        return Cinv

    def pdf(self, xs):
        assert xs.shape[-1] == 2
        p = self.C * exp(
            self.kappa[0] * cos(xs[..., 0] - self.mu[0])
            + self.kappa[1] * cos(xs[..., 1] - self.mu[1]) (duplicate-code)

------------------------------------
Your code has been rated at 10.00/10

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

github-actions bot commented Apr 1, 2026

Test Results

   12 files     12 suites   3h 15m 51s ⏱️
  599 tests   599 ✅     0 💤 0 ❌
7 400 runs  6 176 ✅ 1 224 💤 0 ❌

Results for commit 02879f6.

♻️ This comment has been updated with latest results.

@FlorianPfaff FlorianPfaff enabled auto-merge April 1, 2026 15:40
@FlorianPfaff
Copy link
Copy Markdown
Owner

@copilot Can you make pyrecest.tests.distributions.test_toroidal_von_mises_cosine_distribution use functionality of or share functionality with
pyrecest.tests.distributions.test_toroidal_von_mises_sine_distribution to prevent duplicate code?

…ne test classes

Agent-Logs-Url: https://github.com/FlorianPfaff/PyRecEst/sessions/21f93465-a948-420c-adf1-090db0d9281e

Co-authored-by: FlorianPfaff <6773539+FlorianPfaff@users.noreply.github.com>
auto-merge was automatically disabled April 2, 2026 11:24

Head branch was pushed to by a user without write access

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 2, 2026

@copilot Can you make pyrecest.tests.distributions.test_toroidal_von_mises_cosine_distribution use functionality of or share functionality with
pyrecest.tests.distributions.test_toroidal_von_mises_s...

Done in commit 02879f6. A ToroidalBivarVMTestMixin class has been extracted into test_toroidal_von_mises_sine_distribution.py. It holds the shared tests (test_integral, test_trigonometric_moment_numerical, test_plot_2d, and the parameterized test_pdf). Both ToroidalVMSineDistributionTest and ToroidalVMCosineDistributionTest now inherit from this mixin and only implement their distribution-specific parts (setUp, _unnormalized_pdf, and any extra tests).

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