Repository navigation
Conversation
distance() calls math.sqrt but the module never imported math, so test_chaiken_algorithm raised NameError at its first self.distance() call instead of checking the smoothed geometry. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Can you show me how it was failing in an existing CI run? I can't understand why we wouldn't have caught it yet |
|
You're right to push back — it is not failing in CI, and it never has. I dug into What CI actually does with this file
and its with Why it passes despite
|
|
@Anai-Guo, that message was for you, the human |
… dependencies' when add-apt-repository could not reach Launchpad)
|
Please read our AI policy and keep it clear and short. |
vector/v.generalize/testsuite/v_generalize_test.pyusesmath.sqrtinTestVGeneralize.distance(), but the module never importsmath:test_chaiken_algorithmcallsself.distance(midpoint, vertex)(line 256) insideits midpoint-proximity loop, so the test raises
NameError: name 'math' is not definedon the first iteration and never reaches theassertLessEqual/vertex-count assertions it was written to make.
Fix: add the missing
import math.Verification
Stubbing
grass.script/grass.gunittestand calling the method directly(no GRASS build needed):
ruff check --previewandruff format --check(v0.15.17, the pinned.pre-commit-config.yamlrev, with the repopyproject.toml) pass on thepatched file.
I001is already disabled forvector/**.py, but the threestandard-library imports are left alphabetically ordered anyway.
AI-assisted (bug found by a pyflakes sweep, fix and verification reviewed by
me before submitting); per
CONTRIBUTING.mdthe change is a one-line import,not generated logic.
🤖 Generated with Claude Code