Skip to content

Added point set registration#1742

Open
FlorianPfaff wants to merge 7 commits intomainfrom
pointsetreg
Open

Added point set registration#1742
FlorianPfaff wants to merge 7 commits intomainfrom
pointsetreg

Conversation

@FlorianPfaff
Copy link
Copy Markdown
Owner

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 19, 2026

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 11.8s
✅ JSON prettier 2 0 0 0 0.76s
✅ JSON v8r 2 0 0 2.79s
✅ MARKDOWN markdownlint 1 0 0 0 0.65s
✅ MARKDOWN markdown-table-formatter 1 0 0 0 0.24s
✅ PYTHON bandit 333 0 0 4.78s
✅ PYTHON black 333 8 0 0 8.23s
✅ PYTHON flake8 333 0 0 2.71s
✅ PYTHON isort 333 10 0 0 0.65s
✅ PYTHON mypy 333 0 0 4.6s
✅ PYTHON pylint 333 0 0 99.73s
✅ PYTHON ruff 333 10 0 0 0.06s
✅ REPOSITORY checkov yes no no 21.21s
✅ REPOSITORY gitleaks yes no no 6.59s
✅ REPOSITORY git_diff yes no no 0.13s
✅ REPOSITORY secretlint yes no no 6.47s
✅ REPOSITORY syft yes no no 3.72s
✅ REPOSITORY trivy-sbom yes no no 2.25s
✅ REPOSITORY trufflehog yes no no 19.24s
✅ YAML prettier 4 0 0 0 0.47s
✅ YAML v8r 4 0 0 5.53s
✅ YAML yamllint 4 0 0 0.43s

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
Copy link
Copy Markdown
Owner Author

@copilot Do not use numpy but rather import from pyrecest.backend (see other files).

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 19, 2026

@copilot Do not use numpy but rather import from pyrecest.backend (see other files).

Done in d881dee. Replaced all numpy usage with imports from pyrecest.backend in both the module and test file. Also moved the files to their correct locations under pyrecest/utils/ and pyrecest/tests/ to match the project structure and the import path pyrecest.utils.point_set_registration.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 19, 2026

Test Results

    12 files  ± 0     12 suites  ±0   4h 22m 0s ⏱️ + 3m 37s
   991 tests + 6    991 ✅ + 6      0 💤 ± 0  0 ❌ ±0 
12 176 runs  +72  9 420 ✅ +48  2 756 💤 +24  0 ❌ ±0 

Results for commit 46ca2b6. ± Comparison against base commit 224177b.

♻️ This comment has been updated with latest results.

@FlorianPfaff
Copy link
Copy Markdown
Owner Author

@copilot Fix this (suppress too-many and redefined-builtin linter warnings)

=========================== short test summary info ============================
FAILED pyrecest/tests/test_point_set_registration.py::TestEstimateTransform::test_estimate_affine_transform_recovers_ground_truth - TypeError: full(): argument 'size' (position 1) must be tuple of ints, not int
FAILED pyrecest/tests/test_point_set_registration.py::TestEstimateTransform::test_estimate_rigid_transform_recovers_rotation_and_translation - TypeError: full(): argument 'size' (position 1) must be tuple of ints, not int
FAILED pyrecest/tests/test_point_set_registration.py::TestGatedAssignment::test_solve_gated_assignment_leaves_rows_unmatched - TypeError: isfinite(): argument 'input' (position 1) must be Tensor, not float
FAILED pyrecest/tests/test_point_set_registration.py::TestJointRegistrationAssignment::test_joint_registration_assignment_handles_missing_points_and_outliers - TypeError: isfinite(): argument 'input' (position 1) must be Tensor, not float
FAILED pyrecest/tests/test_point_set_registration.py::TestJointRegistrationAssignment::test_joint_registration_assignment_recovers_permuted_affine_matches - TypeError: isfinite(): argument 'input' (position 1) must be Tensor, not float
FAILED pyrecest/tests/test_point_set_registration.py::TestJointRegistrationAssignment::test_joint_registration_assignment_supports_custom_cost_function - TypeError: isfinite(): argument 'input' (position 1) must be Tensor, not float
= 6 failed, 782 passed, 163 skipped, 5585382 warnings, 18 subtests passed in 2027.88s (0:33:47) =

❌ PYTHON / mypy - 3 errors
pyrecest/utils/point_set_registration.py:74: error: "object" has no attribute "shape" [attr-defined]
pyrecest/utils/point_set_registration.py:402: error: Unsupported left operand type for - ("object") [operator]
pyrecest/utils/point_set_registration.py:403: error: Unsupported left operand type for - ("object") [operator]
Found 3 errors in 1 file (checked 333 source files)
❌ PYTHON / pylint - 8 errors
************* Module pyrecest.tests.test_point_set_registration
pyrecest/tests/test_point_set_registration.py:105:30: E1136: Value 'result.assignment' is unsubscriptable (unsubscriptable-object)
************* Module pyrecest.utils.point_set_registration
pyrecest/utils/point_set_registration.py:19:0: W0622: Redefining built-in 'any' (redefined-builtin)
pyrecest/utils/point_set_registration.py:19:0: W0622: Redefining built-in 'sum' (redefined-builtin)
pyrecest/utils/point_set_registration.py:74:15: E1101: Instance of 'object' has no 'shape' member (no-member)
pyrecest/utils/point_set_registration.py:99:0: R0902: Too many instance attributes (9/7) (too-many-instance-attributes)
pyrecest/utils/point_set_registration.py:156:0: R0914: Too many local variables (25/15) (too-many-locals)
pyrecest/utils/point_set_registration.py:277:0: R0913: Too many arguments (10/6) (too-many-arguments)
pyrecest/utils/point_set_registration.py:277:0: R0914: Too many local variables (31/15) (too-many-locals)

…es, pylint suppressions

Agent-Logs-Url: https://github.com/FlorianPfaff/PyRecEst/sessions/ebf6a613-6de4-4f32-bd97-b8aa44ec916e

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

Copilot AI commented Apr 20, 2026

@copilot Fix this (suppress too-many and redefined-builtin linter warnings)

=========================== short test summary info ============================
...

Fixed in 3d1f550:

  • Test failures: full(n, ...)full((n,), ...) (backend requires tuple); isfinite(float)math.isfinite(float) (backend isfinite only accepts tensors, not Python float)
  • mypy errors: Changed object type hints to Any on AffineTransform.matrix/offset and RegistrationResult array fields
  • pylint redefined-builtin: Added # pylint: disable=redefined-builtin,no-name-in-module,no-member to the backend import blocks in both files
  • pylint too-many-*: Added inline suppressions on RegistrationResult (too-many-instance-attributes), estimate_transform (too-many-locals), and joint_registration_assignment (too-many-arguments,too-many-positional-arguments,too-many-locals)

@FlorianPfaff
Copy link
Copy Markdown
Owner Author

@copilot fix what happened below for the pytorch backend

=========================== short test summary info ============================
FAILED pyrecest/tests/test_point_set_registration.py::TestJointRegistrationAssignment::test_joint_registration_assignment_handles_missing_points_and_outliers - TypeError: '<' not supported between instances of 'builtin_function_or_method' and 'int'
FAILED pyrecest/tests/test_point_set_registration.py::TestJointRegistrationAssignment::test_joint_registration_assignment_recovers_permuted_affine_matches - TypeError: '<' not supported between instances of 'builtin_function_or_method' and 'int'
FAILED pyrecest/tests/test_point_set_registration.py::TestJointRegistrationAssignment::test_joint_registration_assignment_supports_custom_cost_function - TypeError: '<' not supported between instances of 'builtin_function_or_method' and '

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

@copilot fix what happened below for the pytorch backend

=========================== short test summary info ============================
...

Fixed in 6332aa2. Two PyTorch incompatibilities were causing the failures:

  1. .size is a method in PyTorch (not a property like in NumPy), so tensor.size < int was comparing a bound method to an integer. Replaced all five .size usages with len(), which is backend-agnostic.

  2. .astype(int64) is NumPy-only — PyTorch uses .to(dtype). Replaced all four .astype(int64) calls with cast(x, int64) from pyrecest.backend, which works on both backends.

All 6 tests now pass on both numpy and pytorch backends.

@FlorianPfaff
Copy link
Copy Markdown
Owner Author

@copilot suppress this warning

************* Module pyrecest.utils.point_set_registration
pyrecest/utils/point_set_registration.py:102:0: R0902: Too many instance attributes (9/7) (too-many-instance-attributes)


Your code has been rated at 10.00/10

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

@copilot suppress this warning

************* Module pyrecest.utils.point_set_registration
...

Fixed in d64753b. Moved the # pylint: disable=too-many-instance-attributes comment from the decorator line to the class RegistrationResult: line, where pylint actually reports the warning.

@FlorianPfaff
Copy link
Copy Markdown
Owner Author

@copilot Can you make the respective function calls fail with an assertion for the jax backend? Use skipif for the test cases (see other files).

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

@copilot Can you make the respective function calls fail with an assertion for the jax backend? Use skipif for the test cases (see other files).

Done in bcd9d50. Added assert pyrecest.backend.__backend_name__ != "jax", "Not supported for the JAX backend." at the start of estimate_transform, solve_gated_assignment, and joint_registration_assignment. All 6 test methods now have @unittest.skipIf(pyrecest.backend.__backend_name__ == "jax", reason="Not supported on this backend") decorators, matching the pattern used in other test files.

@FlorianPfaff FlorianPfaff force-pushed the main branch 3 times, most recently from 7b21428 to 429a157 Compare April 21, 2026 13:50
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