Skip to content

Fix hypertoroidal Dirac transform dimension tracking - #5346

Merged
FlorianPfaff merged 2 commits into
mainfrom
agent/fix-hypertoroidal-dirac-transform-dimension
Aug 18, 2026
Merged

Fix hypertoroidal Dirac transform dimension tracking#5346
FlorianPfaff merged 2 commits into
mainfrom
agent/fix-hypertoroidal-dirac-transform-dimension

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

HypertoroidalDiracDistribution.apply_function() currently inherits the generic Dirac transform behavior, which permits coordinate-dimension changes, but it keeps the original manifold dimension metadata. For example, transforming 3-D torus particles with points[:, :2] produces support of shape (n, 2) while dim remains 3; subsequent operations such as trigonometric_moment() then combine incompatible shapes.

This PR:

  • derives the transformed torus dimension from the transformed support,
  • returns a consistent generic HypertoroidalDiracDistribution when the coordinate dimension changes,
  • preserves the existing concrete distribution object when the dimension is unchanged,
  • rejects malformed transform outputs that are neither (n,) nor (n, dim) with positive dimension,
  • adds a regression that reduces a 3-D support to 2-D and verifies that trigonometric moments remain usable.

Validation

A focused regression test is included in tests/distributions/test_hypertoroidal_dirac_apply_function_dimension.py. Full validation is delegated to the repository CI because the local execution environment does not contain a PyRecEst installation.

@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 5.53s
✅ JSON prettier 7 0 0 0 0.68s
✅ JSON v8r 7 0 0 4.52s
✅ MARKDOWN markdownlint 68 0 0 0 1.72s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.32s
✅ PYTHON black 1984 11 0 0 56.97s
✅ PYTHON isort 1984 21 0 0 2.33s
✅ REPOSITORY betterleaks yes no no 1.13s
✅ REPOSITORY checkov yes no no 31.86s
✅ REPOSITORY git_diff yes no no 0.1s
✅ REPOSITORY secretlint yes no no 87.23s
✅ REPOSITORY syft yes no no 2.67s
✅ REPOSITORY trivy-sbom yes no no 1.7s
✅ YAML prettier 11 0 0 0 0.59s
✅ YAML v8r 11 0 0 9.3s
✅ YAML yamllint 11 0 0 1.01s

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 marked this pull request as ready for review August 18, 2026 19:16
@FlorianPfaff
FlorianPfaff merged commit edf644c into main Aug 18, 2026
15 of 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