Skip to content

[codex] Update pyrecest/sampling/euclidean_sampler.py#1798

Open
FlorianPfaff wants to merge 4 commits intomainfrom
split-20-euclidean-sampler
Open

[codex] Update pyrecest/sampling/euclidean_sampler.py#1798
FlorianPfaff wants to merge 4 commits intomainfrom
split-20-euclidean-sampler

Conversation

@FlorianPfaff
Copy link
Copy Markdown
Owner

Summary

  • split out the current local changes for pyrecest/sampling/euclidean_sampler.py into its own PR
  • keeps this file independent from the other pending pyrecest/ edits

Validation

  • not run

@FlorianPfaff FlorianPfaff marked this pull request as ready for review April 22, 2026 11:10
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

MegaLinter analysis: Error

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 17.76s
✅ JSON prettier 2 0 0 0 0.47s
✅ JSON v8r 2 0 0 2.87s
✅ MARKDOWN markdownlint 2 0 0 0 0.69s
✅ MARKDOWN markdown-table-formatter 2 0 0 0 0.19s
✅ PYTHON bandit 351 0 0 5.26s
✅ PYTHON black 351 8 0 0 8.6s
✅ PYTHON flake8 351 0 0 2.98s
✅ PYTHON isort 351 13 0 0 0.7s
✅ PYTHON mypy 351 0 0 4.96s
❌ PYTHON pylint 351 5 0 110.44s
✅ PYTHON ruff 351 13 0 0 0.07s
✅ REPOSITORY checkov yes no no 24.02s
✅ REPOSITORY gitleaks yes no no 10.53s
✅ REPOSITORY git_diff yes no no 0.06s
✅ REPOSITORY secretlint yes no no 6.81s
✅ REPOSITORY syft yes no no 3.54s
✅ REPOSITORY trivy-sbom yes no no 2.52s
✅ REPOSITORY trufflehog yes no no 20.92s
✅ YAML prettier 4 0 0 0 0.43s
✅ YAML v8r 4 0 0 4.83s
✅ YAML yamllint 4 0 0 0.48s

Detailed Issues

❌ PYTHON / pylint - 5 errors
************* Module update_init_helper
update_init_helper.py:1:0: R0801: Similar lines in 2 files
==pyrecest.utils.nonrigid_point_set_registration:[211:221]
==pyrecest.utils.point_set_registration:[241:251]
    costs = asarray(cost_matrix)
    if costs.ndim != 2:
        raise ValueError("cost_matrix must be two-dimensional.")
    if costs.shape[0] == 0:
        return zeros((0,), dtype=int64)
    if costs.shape[1] == 0:
        return zeros((costs.shape[0],), dtype=int64) - 1

    finite_mask = isfinite(costs)
    finite_costs = costs[finite_mask] (duplicate-code)
update_init_helper.py:1:0: R0801: Similar lines in 2 files
==pyrecest.utils.nonrigid_point_set_registration:[124:135]
==pyrecest.utils.point_set_registration:[107:118]
    assignment: Any
    matched_reference_indices: Any
    matched_moving_indices: Any
    transformed_reference_points: Any
    matched_costs: Any
    rmse: float
    n_iterations: int
    converged: bool


def _as_point_array(points): (duplicate-code)
update_init_helper.py:1:0: R0801: Similar lines in 2 files
==pyrecest.utils.nonrigid_point_set_registration:[319:329]
==pyrecest.utils.point_set_registration:[390:400]
    association_cost = _default_cost if cost_function is None else cost_function

    for iteration in range(1, max_iterations + 1):
        transformed_reference = transform.apply(reference)
        current_costs = asarray(association_cost(transformed_reference, moving))
        if current_costs.shape != (reference.shape[0], moving.shape[0]):
            raise ValueError(
                "cost_function must return an array of shape (n_reference, n_moving)."
            )
 (duplicate-code)
update_init_helper.py:1:0: R0801: Similar lines in 2 files
==pyrecest.utils.nonrigid_point_set_registration:[146:154]
==pyrecest.utils.point_set_registration:[129:137]
    source = _as_point_array(source_points)
    target = _as_point_array(target_points)
    if source.shape != target.shape:
        raise ValueError("source_points and target_points must have the same shape.")
    return source, target


def _normalize_weights(weights, n_points): (duplicate-code)
update_init_helper.py:1:0: R0801: Similar lines in 2 files
==pyrecest.utils.nonrigid_point_set_registration:[230:236]
==pyrecest.utils.point_set_registration:[262:268]
    row_indices, col_indices = linear_sum_assignment(padded_costs)
    assignment = zeros((costs.shape[0],), dtype=int64) - 1

    for row_index, col_index in zip(row_indices, col_indices):
        if row_index >= costs.shape[0] or col_index >= costs.shape[1]:
            continue (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

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