Skip to content

Port the six Figure-2 screen geometries from the HTML tool - #7

Merged
shepherd70 merged 1 commit into
mainfrom
feature/geometries
Aug 23, 2026
Merged

shepherd70 merged 1 commit into
mainfrom
feature/geometries

Conversation

@shepherd70

Copy link
Copy Markdown
Owner

Summary

Closes the last substantive Milestone PY item (only the v0.1.0 tag remains).

  • geometry.py mirrors the HTML tool's GEOMETRIES block: disc, panel, box, cylinder (T-screen body), cone, and half-barrel, each with its gross surface-area formula (Figure 2, §3.7) and closed-form dimension solver.
  • size_screen() supports the tool's two modes: solve one free dimension against the required gross area — rounded up to a 1 mm build increment, never down, so rounding can't turn a pass into a fail — or check fully-fixed dimensions with a PASS/FAIL verdict. units splits the required area across identical screen units.
  • CLI: --geometry, --dim KEY=METRES (repeatable), --solve-for, --units on single-intake runs; --json gains a nested geometry object. Batch CSV mode doesn't support geometry yet (tracked as a follow-up).
  • The tool's extra de-rating factors (fouling, submergence, support blockage) stay out of scope: the package models de-rating through its open-area ratio + blockage allowance.
  • README gains a fourth worked example (two-unit cylinder solve, output verified against a real run).

Test plan

  • uv run pytest: 42/42 passing (was 26) — per-shape area formulas checked against Figure 2, solve round-trips for every dimension of every shape, 1 mm round-up + re-check sufficiency, unit splitting, check-mode PASS/FAIL, impossible-solve (negative box width) and bad-input errors, CLI solve/check/JSON/error paths
  • uv run ruff check . and uv run mypy clean; CI runs the same gates

🤖 Generated with Claude Code

New geometry.py mirrors the tool's GEOMETRIES block: disc, panel, box,
cylinder (T-screen body), cone, and half-barrel, each with its gross
surface-area formula (Figure 2, §3.7) and closed-form dimension solver.

size_screen() supports the tool's two modes: solve one free dimension
against the required gross area (rounded UP to a 1 mm build increment —
never down, so rounding can't turn a pass into a fail) or check
fully-fixed dimensions PASS/FAIL. --units N splits the required area
across identical screen units.

CLI: --geometry/--dim KEY=METRES/--solve-for/--units on single-intake
runs; JSON output gains a nested geometry object. Not yet wired into
batch CSV mode (tracked).

The tool's extra de-rating factors (fouling, submergence, support
blockage) stay out of scope — the package models de-rating through its
open-area ratio and blockage allowance.

Tests 26 -> 42: per-shape area formulas, solve round-trips for every
dimension of every shape, round-up behaviour, unit splitting,
check-mode verdicts, impossible-solve and bad-input errors, CLI paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@shepherd70
shepherd70 merged commit b72bccb into main Aug 23, 2026
@shepherd70
shepherd70 deleted the feature/geometries branch August 23, 2026 17:24
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