Skip to content

Fix 3 bugs in EOT shape database#1574

Merged
FlorianPfaff merged 1 commit intomainfrom
copilot/eotnew202512-bug-fixes
Mar 31, 2026
Merged

Fix 3 bugs in EOT shape database#1574
FlorianPfaff merged 1 commit intomainfrom
copilot/eotnew202512-bug-fixes

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Three bugs in eot_shape_database.py and its test file — incorrect return type, array dimension mismatch, and a misapplied decorator.

Changes

  • sample_within() return type (eot_shape_database.py:58): Was returning np.array(points) — an object array of Shapely Point instances. Fixed to np.array([(p.x, p.y) for p in points]), matching the behavior of the already-correct sample_on_boundary().

  • Dimension mismatch in compute_visibility_polygon() (eot_shape_database.py:108): np.array(point.coords) yields shape (1, 2) not (2,). Subtraction with a (2,) vertex silently broadcast, producing a (1, 2) direction vector passed to Point(...) as the far-away point.

    # Before (broken)
    direction = np.array(vertex) - np.array(point.coords)    # shape (1, 2)
    # After
    direction = np.array(vertex) - np.array(point.coords[0]) # shape (2,)
  • @classmethod on setUp() (test_eot_shape_database.py:59): setUp is a per-instance lifecycle method; the decorator caused it to receive the class as self, setting starfish as a class attribute and silently breaking test isolation. Removed the decorator.

…ty polygon dimension, and @classmethod on setUp

Agent-Logs-Url: https://github.com/FlorianPfaff/PyRecEst/sessions/27f787c9-722d-4cc0-93e6-0ff0f3f8e4f6

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

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 6.98s
✅ JSON prettier 2 0 0 0 0.39s
✅ JSON v8r 2 0 0 2.79s
✅ MARKDOWN markdownlint 1 0 0 0 0.64s
✅ MARKDOWN markdown-table-formatter 1 0 0 0 0.2s
✅ PYTHON bandit 247 0 0 3.05s
✅ PYTHON black 247 0 0 0 4.34s
✅ PYTHON flake8 247 0 0 1.69s
✅ PYTHON isort 247 2 0 0 0.48s
✅ PYTHON mypy 247 0 0 4.01s
✅ PYTHON pylint 247 0 0 68.41s
✅ PYTHON ruff 247 2 0 0 0.04s
✅ REPOSITORY checkov yes no no 21.71s
✅ REPOSITORY gitleaks yes no no 3.9s
✅ REPOSITORY git_diff yes no no 0.04s
✅ REPOSITORY secretlint yes no no 6.0s
✅ REPOSITORY syft yes no no 2.81s
✅ REPOSITORY trivy-sbom yes no no 1.78s
✅ REPOSITORY trufflehog yes no no 16.87s
✅ YAML prettier 4 0 0 0 0.5s
✅ YAML v8r 4 0 0 5.03s
✅ 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 FlorianPfaff merged commit b2c013e into main Mar 31, 2026
17 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.

2 participants