Skip to content

Preserve low-rank Fourier subclasses in operations - #5374

Draft
FlorianPfaff wants to merge 2 commits into
mainfrom
fix/low-rank-fourier-subclass-preservation
Draft

Preserve low-rank Fourier subclasses in operations#5374
FlorianPfaff wants to merge 2 commits into
mainfrom
fix/low-rank-fourier-subclass-preservation

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Bug

LowRankHypertoroidalFourierDistribution used hard-coded base-class constructors in several instance operations. Consequently, subclasses silently collapsed back to LowRankHypertoroidalFourierDistribution after:

  • shift()
  • centered_hermitianized()
  • multiply()
  • convolve()
  • dense Fourier coercion inside binary operations

This is inconsistent with the subclass-preserving factory/operation contract used elsewhere in PyRecEst (including the dense Fourier and Fejer Fourier implementations).

Fix

Construct operation results through type(self) and convert dense operands through type(self).from_dense(...). Numerical formulas, tensor-train operations, normalization, and public signatures are unchanged.

Regression coverage

Adds a focused NumPy-only regression using a derived low-rank Fourier class. It verifies exact subclass preservation for shift, Hermitian repair, multiplication and convolution, including binary operations with a dense HypertoroidalFourierDistribution operand.

Scope

  • based directly on main at baac3b1736bb8e81eafc1e3f69e10104636103b9
  • 2 commits ahead, 0 behind at PR creation
  • production diff: 5 additions / 5 deletions
  • one 49-line regression test added
  • no overlap found with the currently open low-rank/Fourier bug-fix PRs

@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 6.99s
✅ JSON prettier 7 0 0 0 0.57s
✅ JSON v8r 7 0 0 4.29s
✅ MARKDOWN markdownlint 68 0 0 0 2.62s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.45s
✅ PYTHON black 1989 15 0 0 65.83s
✅ PYTHON isort 1989 27 0 0 2.94s
✅ REPOSITORY betterleaks yes no no 1.64s
✅ REPOSITORY checkov yes no no 34.68s
✅ REPOSITORY git_diff yes no no 0.16s
✅ REPOSITORY secretlint yes no no 104.06s
✅ REPOSITORY syft yes no no 2.57s
✅ REPOSITORY trivy-sbom yes no no 2.83s
✅ YAML prettier 11 0 0 0 1.01s
✅ YAML v8r 11 0 0 17.48s
✅ YAML yamllint 11 0 0 1.12s

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

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