- src/homemaker/ → src/homemaker_layout/; all imports updated - pyproject.toml: name = homemaker-layout, entry point updated - .beads/config.yaml: dolt sync.remote updated to homemaker-layout.git - Delete temporary debug/perl scripts from project root - README.md, DESIGN.md: package path references updated - GitHub repo renamed; git remote updated Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
26 lines
751 B
Python
26 lines
751 B
Python
"""Dump per-leaf areas from a .dom using the Python geometry port.
|
|
|
|
Used to validate the port against a Perl dump from Urb (see the sibling
|
|
``dump_areas.pl``). Output: one line per leaf, ``level/idpath type area``,
|
|
sorted for a stable diff.
|
|
"""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
|
|
|
|
from homemaker_layout import dom, geometry # noqa: E402
|
|
|
|
|
|
def main(path: str) -> None:
|
|
root = dom.load(path)
|
|
rows = []
|
|
for level_idx, lvl in enumerate(dom.levels(root)):
|
|
for leaf in lvl.leaves():
|
|
rows.append(f"{level_idx}/{leaf.id} {leaf.type or '?'} {geometry.area(leaf):.4f}")
|
|
print("\n".join(sorted(rows)))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main(sys.argv[1])
|