Public-access term (preserve_public_access, default on): when the building's only street access is an l/k ROOM neighbour of a public outside leaf (no circulation fallback — an existential building-level check the per-leaf objective can't see), that leaf is pinned (kept, its demand slot decremented) so the collapse can't drop "no outside public access". Best layout 15→13 becomes 15→12 with zero new fails; sweep total 172→171, still monotone. collapse_finish(root, **kw) -> (tree, base, coll, applied): keep-better wrapper, scores on throwaway copies (score_with_fails merges in place), returns the collapse only if fails don't increase. Wiring: driver.collapse_best updates result.best (lineage +collapse, canonical re-score); evolve.py runs it after the sharing polish behind --collapse/ --no-collapse (default on). New homemaker-collapse CLI (collapse_cmd.py) applies it to an existing .dom, writing <stem>.collapsed.dom. tests/test_collapse_global.py: demand-set relabel, level hard constraint, c/o/s exclusion, no-op safety, keep-better/unmerged. 267 pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M8566xAxTnwtJTkpXjYNZm
34 lines
780 B
TOML
34 lines
780 B
TOML
[project]
|
|
name = "homemaker-layout"
|
|
version = "0.0.1"
|
|
description = "Programme-driven building layout search over slicing trees (Python successor to Urb)"
|
|
requires-python = ">=3.11"
|
|
dependencies = [
|
|
"pyyaml>=6.0",
|
|
"numpy>=1.26",
|
|
"scipy>=1.11",
|
|
"shapely>=2.0",
|
|
"networkx>=3.0",
|
|
"cma>=3.0",
|
|
]
|
|
|
|
[project.scripts]
|
|
homemaker-evolve = "homemaker_layout.evolve:main"
|
|
homemaker-fitness = "homemaker_layout.fitness_cmd:main"
|
|
homemaker-collapse = "homemaker_layout.collapse_cmd:main"
|
|
|
|
[project.optional-dependencies]
|
|
dev = ["pytest>=8.0", "ruff>=0.5"]
|
|
|
|
[build-system]
|
|
requires = ["setuptools>=68"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["src"]
|
|
|
|
[tool.pytest.ini_options]
|
|
pythonpath = ["src"]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|