Skip to content

Preserve hypercylindrical subdivision subclasses - #5371

Draft
FlorianPfaff wants to merge 2 commits into
mainfrom
fix/hsssd-subclass-factories
Draft

Preserve hypercylindrical subdivision subclasses#5371
FlorianPfaff wants to merge 2 commits into
mainfrom
fix/hsssd-subclass-factories

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Bug

HypercylindricalStateSpaceSubdivisionDistribution.from_distribution() and from_function() were static factories that hard-coded the base class. Because convert_distribution(source, TargetSubclass, ...) dispatches through the requested target class's inherited from_distribution, conversions to a subclass silently returned the base HypercylindricalStateSpaceSubdivisionDistribution instead.

The same subtype loss occurred for direct inherited TargetSubclass.from_function(...) calls.

Fix

  • convert both factories to classmethods
  • dispatch from_distribution through cls.from_function(...)
  • construct the final subdivision distribution through cls(...)
  • leave grid construction, conditional normalization, integration, and all numerical behavior unchanged

Regression coverage

Adds focused NumPy/SciPy-backed regressions for:

  1. inherited from_function(...) preserving the requested subclass;
  2. convert_distribution(..., TargetSubclass, no_of_grid_points=...) preserving the requested subclass.

Scope

@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 4.28s
✅ JSON prettier 7 0 0 0 0.52s
✅ JSON v8r 7 0 0 2.5s
✅ MARKDOWN markdownlint 68 0 0 0 1.62s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.25s
✅ PYTHON black 1989 16 0 0 34.98s
✅ PYTHON isort 1989 28 0 0 1.59s
✅ REPOSITORY betterleaks yes no no 0.88s
✅ REPOSITORY checkov yes no no 21.87s
✅ REPOSITORY git_diff yes no no 0.13s
✅ REPOSITORY secretlint yes no no 54.17s
✅ REPOSITORY syft yes no no 1.68s
✅ REPOSITORY trivy-sbom yes no no 1.35s
✅ YAML prettier 11 0 0 0 0.47s
✅ YAML v8r 11 0 0 9.49s
✅ YAML yamllint 11 0 0 0.4s

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