Skip to content

fix(render): draw the pneumatic hatch from HATCH_ARM and drop Port.side - #573

Merged
Alpha9463 merged 1 commit into
mainfrom
fix/304-hatch-arm-port-side
Oct 3, 2026
Merged

Alpha9463 merged 1 commit into
mainfrom
fix/304-hatch-arm-port-side

Conversation

@Alpha9463

Copy link
Copy Markdown
Owner

Summary

Resolves the last two of the nine dead declarations #304 lists.

  • HATCH_ARM: it named the pneumatic hatch stroke's reach, but neither backend read it. The SVG renderer drew the strokes from bare numbers, and the draw.io exporter hard-coded an angle and length while citing HATCH_ARM as their source. Both now take the stroke from it.
  • Port.side: never passed and never read; it is removed.

No drawing changes.

Related Issues

Closes #304

The other seven names were removed earlier:

Changes

  • pandid/render/svg.py: the pneumatic hatch strokes are built from HATCH_ARM (half-reach along and across the run) instead of the literals 3 and 5. HATCH_ARM has its own doc comment.
  • pandid/render/drawio.py: _HATCH_ANGLE and _HATCH_LEN are derived from HATCH_ARM using atan2 and hypot, and rounded to two places, so they come out as the same -59.04 and 11.66.
  • pandid/ports.py and pandid/units.py: remove Port.side and the unused side parameter of Unit._add_port.
  • tests/test_drawio.py:
    • one test checks that the SVG hatch follows HATCH_ARM; it fails on main;
    • one checks that the draw.io hatch strokes have the SVG strokes' angle and length;
    • the existing pneumatic test now shares their sheet-building helper.
  • CHANGELOG.md: a "Changed" entry for the hatch and a "Removed" entry for Port.side.

API note: Port is exported, and side is removed without a deprecation release, as b838106 did for the earlier names. Code that read port.side (always None) or built a Port with side= will break. Nothing in the package, examples, docs or scripts does either.

How to Test

python3 -m pytest -q tests/test_drawio.py -k "hatch or pneumatic"
python3 -m pytest -q
python3 -m ruff check .
python3 -m ruff format --check tests
python3 -m mypy pandid
python3 -m pyright pandid

Evidence

  • Renders unchanged: all 21 examples give byte-identical SVG and draw.io output to main. Eight of them draw pneumatic hatches: 04, 08, 11, 14, 15, 17, 18 and 20.
  • Layout unchanged: frames, routes and validation findings are identical to main for 46 drawings (the 21 examples as authored and with placement stripped, plus four benchmark sheets).
  • Full suite: 11,570 passed, 188 skipped (Python 3.14).
  • Lint and types:

Checklist

  • Base branch is main and the branch is mergeable
  • Commit subjects follow Conventional Commits; tracked work links its issue
  • Self-reviewed the full diff on the Files changed tab
  • Relevant local checks pass; all CI jobs pass before merge
  • Documentation and examples updated if behaviour changed
  • Before/after drawings included if rendered output changed (no rendered output changed)
  • Blocking review feedback resolved, if review was requested

🤖 Generated with Claude Code

@Alpha9463
Alpha9463 merged commit c78b803 into main Oct 3, 2026
7 checks passed
@Alpha9463
Alpha9463 deleted the fix/304-hatch-arm-port-side branch October 3, 2026 09:49
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.

Remove remaining unused declarations: HATCH_ARM and Port.side

1 participant