fix(M02): 식 없는 계산 열(pv_a · pv_jt · pp_cp)은 빈 값 — 줄눈 간격 줄 식도 열 식이 있을 때만
- 값은 면적산출 알약 연결로 받음(PLAN 13장) · 표 채우기 시험을 새 규칙으로 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EUypcnp5d1gU2aeKh9F2H7
This commit is contained in:
@@ -437,15 +437,16 @@ def fill_document(
|
||||
cells = slots[slot]["값"]
|
||||
cells[column["id"]] = round((cells.get(column["id"]) or 0) + value, 3)
|
||||
|
||||
# 포장 줄눈 간격이 변수와 다르면 그 줄 식에 박음(줄 식이 열 식을 이김)
|
||||
# 포장 줄눈 간격이 변수와 다르면 그 줄 식에 박음(줄 식이 열 식을 이김) · 열 식이 없으면 안 박음
|
||||
# (식 없는 계산 열은 빈 값 — 값은 면적산출 알약 연결로 받음 · PLAN 13장)
|
||||
base_spacing = _number(variables.get("수축줄눈_간격_m"))
|
||||
for item, slot in zip(items, item_slot, strict=True):
|
||||
spacing = _number(item["options"].get("joint_spacing_m"))
|
||||
if item["type_id"] != "pavement_concrete" or spacing in (None, base_spacing):
|
||||
continue
|
||||
for new_id, suffix, new in made.get("pv_jt", []):
|
||||
if "|".join(_expansion({"펼침": ["thickness_cm"]}, item)) == suffix:
|
||||
text = new.get("식", "").replace("[$수축줄눈_간격_m]", _label("", spacing))
|
||||
if new.get("식") and "|".join(_expansion({"펼침": ["thickness_cm"]}, item)) == suffix:
|
||||
text = new["식"].replace("[$수축줄눈_간격_m]", _label("", spacing))
|
||||
slots[slot].setdefault("식", {})[new_id] = text
|
||||
|
||||
missing = sum(1 for item in items if item["type_id"] == "pipe" and not item.get("관연장"))
|
||||
|
||||
@@ -123,12 +123,14 @@ def test_계산_열은_설계값_딱지_없음(project: Path) -> None:
|
||||
assert [c["id"] for c in again["열"]] == [c["id"] for c in doc["열"]]
|
||||
|
||||
|
||||
def test_계산_열_식은_같은_묶음_열로_바뀌고_빈_변수면_안_셈(project: Path) -> None:
|
||||
def test_계산_열_식은_같은_묶음_열로_바뀌고_식_없으면_빈_값(project: Path) -> None:
|
||||
doc = _filled(project)
|
||||
assert _col(doc, "pv_a|20")["식"] == 'IF([pv_l|20]>0,[pv_b|20]*[pv_l|20]+[pv_w|20],"")'
|
||||
cp = _col(doc, "pp_cp|파형강관|1000")["식"]
|
||||
assert "[pp_len|파형강관|1000]" in cp and "[$파형강관_1본_m]" in cp
|
||||
assert "식" not in _col(doc, "pp_cp|흄관|1000") # 흄관 1본 길이 빈칸 → 계산 안 함
|
||||
# 식을 지운 계산 열(pv_a · pv_jt · pp_cp) = 빈 값 — 값은 면적산출 알약 연결로 받음(PLAN 13장)
|
||||
for col_id in ("pv_a|20", "pv_jt|20", "pp_cp|파형강관|1000", "pp_cp|흄관|1000"):
|
||||
assert "식" not in _col(doc, col_id), col_id
|
||||
assert all(
|
||||
col_id not in row["값"] and col_id not in (row.get("식") or {}) for row in doc["줄"]
|
||||
)
|
||||
assert _col(doc, "bm_area|메쌓기|40~60|2.5")["식"] == (
|
||||
'IF([bm_len|메쌓기|40~60|2.5]>0,[bm_len|메쌓기|40~60|2.5]*2.5,"")'
|
||||
)
|
||||
@@ -148,7 +150,7 @@ def test_측점_줄_같은_측점은_한_줄_관은_나눔(project: Path) -> Non
|
||||
assert first["rv|돌쌓기(찰)|-"] == second["rv|돌쌓기(찰)|-"] == 10
|
||||
assert rows["s300.00"]["값"]["ps"] == 1
|
||||
assert [row["값"].get("no") for row in doc["줄"][1:]] == [str(i) for i in range(1, 8)]
|
||||
assert rows["s200.00~230.00"]["식"]["pv_jt|20"].count("/5)") == 1 # 줄눈 간격 5 박음
|
||||
assert "식" not in rows["s200.00~230.00"] # 줄눈 간격이 달라도 열 식이 없으면 줄 식 없음
|
||||
assert doc["알림"] == []
|
||||
bare = fill.fill_table(project, _master(), {})
|
||||
assert bare["알림"] == ["관 연장 없음 2곳 — B06 횡단 설계 전이면 빈칸"]
|
||||
|
||||
Reference in New Issue
Block a user