Skip to content

fix(docs): drop the unused locals ruff has been failing main on - #54

Merged
kelvin1295 merged 1 commit into
mainfrom
fix/lint-model-diagrams
Aug 20, 2026
Merged

fix(docs): drop the unused locals ruff has been failing main on#54
kelvin1295 merged 1 commit into
mainfrom
fix/lint-model-diagrams

Conversation

@kelvin1295

Copy link
Copy Markdown
Collaborator

main's CI has been red on lint for at least the last five pushes — every one a docs commit from the orchestration-patterns work, none of them touching the code the failure is in. This turns it green.

The six

All in docs/model_orchestration_patterns/build_diagrams.py:

where rule what
lrange F841 ×2 base, bh unpacked, never read
relaxation block F401 import math — no math. anywhere in the file
canvas clamp F841 bw unpacked, never read
_elabel F841 ×2 bw, bh unpacked, never read

bh at the canvas clamp stays — it is read two lines below, at the box[1] = min(max(...)) clamp. Only bw goes there.

Nothing computed is lost: each site reads a list by index, so dropping the name drops no work.

Test plan

  • ruff check .All checks passed
  • Behaviour-preserving, proven by regenerating the diagrams: python3 build_diagrams.py rewrites every committed SVG byte-identically after the change — git status shows only the .py itself
  • Positive control run first: the unmodified script also reproduces the committed SVGs exactly, so the check is capable of seeing a difference rather than passing vacuously

🤖 Generated with Claude Code

Six F-rules in model_orchestration_patterns/build_diagrams.py, all of them
values unpacked and then never read — plus a function-local `import math`
with no `math.` anywhere in the file. Nothing computed is lost: every one
reads a list by index, so removing the name removes no work.

`bh` at the canvas clamp stays — it IS read two lines down; only `bw` goes.

Verified behaviour-preserving by regenerating the diagrams: the script
rewrites every committed SVG byte-identically both before and after, so the
control proves the check can see a change at all.
@kelvin1295
kelvin1295 merged commit 86c3c9f into main Aug 20, 2026
5 checks passed
@kelvin1295
kelvin1295 deleted the fix/lint-model-diagrams branch August 20, 2026 10:04
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