Merge remote-tracking branch 'origin/sub_laptop_1' into sub_laptop_2

This commit is contained in:
2026-11-18 08:49:46 +09:00
5 changed files with 22 additions and 14 deletions
+2 -3
View File
@@ -116,11 +116,10 @@ def test_연결_없으면_빈_표와_연결_없음(tmp_path, monkeypatch):
def test_연결된_사본이_부른_자원만(tmp_path):
"""사본 단가 묶음 통째(고르기 후보 기계 100여)가 아니라 로직이 실제로 부른 줄만."""
from B09_Estimation.B09_Estimation_Linked import used_keys
from M02_MasterTemplete import M02_Item_Prices as item_prices
from resources.tester.test_145_2_b09_labor_calc import copy_files
bundle = item_prices.to_json(item_prices.collect(["GC000268"])) # 기계 시간당 기계경비
files = {
"단가.json": bundle,
**copy_files(["GC000268"]), # 기계 시간당 기계경비 · 사본 = 수식 문서 + 자원 줄(855-F B9-6)
"일위대가.json": {"줄": {"종류": "일위대가", "담은로직": [{"로직": "GC000268"}]}},
"입력값.json": {"GC000268": {"기계": {"값": "0101-0019"}, "지역": {"값": "전국평균"}}},
}
+15 -6
View File
@@ -250,6 +250,19 @@ def _values(given):
return {"GF000219": {k: {"값": v} for k, v in given.items()}}
def copy_files(codes, materials=None) -> dict:
"""사본 셈 파일 견본 — `수식.json`(로직 키 닫힌 문서) + `단가.json`(그 문서 · 자재가 잇는 자원 줄 ·
로직 줄 없음 · 855-F B9-6 · `M02_Item_Source.build_source` 꼴)."""
from M02_MasterTemplete import M02_Doc_Copy as dc
from M02_MasterTemplete import M02_Item_Bundle as item_bundle
docs = dc.closure(item_prices.master()[1], codes)
return {
"수식.json": item_prices.to_json({"그룹": "수식문서", "문서": docs}),
"단가.json": item_prices.to_json(item_bundle.collect(docs, materials)),
}
def _snap(root, owner, key, lines, values, copies=None):
folder = snapshots.structures_dir(root) / snapshots.folder_name(owner)
folder.mkdir(parents=True)
@@ -260,12 +273,8 @@ def _snap(root, owner, key, lines, values, copies=None):
for doc in (copies or {}).values():
codes += [one["로직"] for one in doc["담은로직"] if "로직" in one]
write(snapshots.MANIFEST_NAME, {"원본": {**_item(key), "경로": ["기슭막이", key]}})
from M02_MasterTemplete import M02_Doc_Copy as dc
from M02_MasterTemplete import M02_Item_Bundle as item_bundle
docs = dc.closure(item_prices.master()[1], codes) # 사본 = 수식 문서 + 자원 줄(855-F B9-6)
write("수식.json", item_prices.to_json({"그룹": "수식문서", "문서": docs}))
write("단가.json", item_prices.to_json(item_bundle.collect(docs)))
for name, data in copy_files(codes).items():
write(name, data)
doc = {"종류": "일위대가", "단위": "m", "담은로직": lines, "자재": []}
write("일위대가.json", {"줄": doc, **({"참조사본": copies} if copies else {})})
write("입력값.json", values)
+1 -2
View File
@@ -23,7 +23,6 @@ from B09_Estimation.B09_Estimation_Calc_Labor import compute_labor # noqa: E402
from B09_Estimation.B09_Estimation_Labor_Source import daega_inputs # noqa: E402
from B09_Estimation.B09_Estimation_Linked import linked_resource_keys # noqa: E402
from B09_Estimation.B09_Estimation_Router import compute_sheets # noqa: E402
from M02_MasterTemplete import M02_Item_Prices as item_prices # noqa: E402
PILE = "GF000233" # 말뚝 다듬기 — 원/10개(배 10) · 인력 줄 둘
PIPE = "GF000174" # 흄관 부설 — 하위 로직 줄(GF000155 · GF000160) = 하위 산근
@@ -83,7 +82,7 @@ def test_155_4_산근_자재_자리표시_키_대비표로(tmp_path):
folder = tmp_path / "a"
folder.mkdir()
files = {
"단가.json": item_prices.to_json(item_prices.collect([FUEL])),
**t145.copy_files([FUEL]), # 사본 = 수식 문서 + 자원 줄(855-F B9-6)
"일위대가.json": {"줄": {"종류": "일위대가", "담은로직": [{"로직": FUEL}]}},
"입력값.json": {},
}
+2 -2
View File
@@ -22,7 +22,7 @@ from B09_Estimation import B09_Estimation_Sangeun as sg # noqa: E402
from B09_Estimation.B09_Estimation_Calc_Bill import WHY_LOGIC, compute_estimation # noqa: E402
from B09_Estimation.B09_Estimation_Store import clean_user # noqa: E402
from B09_Estimation.B09_Estimation_Summary import compute_summary, hopyo_lines # noqa: E402
from M02_MasterTemplete import M02_Item_Prices as item_prices # noqa: E402
from resources.tester.test_145_2_b09_labor_calc import copy_files # noqa: E402
IMPORTS = re.compile(r"^import[^;]*;\n", re.MULTILINE)
STONE = "GF000219" # 돌쌓기 메쌓기(인력) — 석공 0.195 · 보통인부 0.156 / ㎡
@@ -156,7 +156,7 @@ def test_저장_다듬기_bill():
def _snapshot(folder: Path, rows, values=None) -> Path:
folder.mkdir(parents=True, exist_ok=True)
files = {
"단가.json": item_prices.to_json(item_prices.collect([STONE, NET])),
**copy_files([STONE, NET]), # 사본 = 수식 문서 + 자원 줄(855-F B9-6)
"일위대가.json": {"줄": {"종류": "일위대가", "담은로직": rows}},
"입력값.json": {k: {n: {"값": v} for n, v in d.items()} for k, d in (values or {}).items()},
}
+2 -1
View File
@@ -209,7 +209,8 @@ def _snap(root, owner, key, lines):
doc = labor.clean({"단위": "m", "담은로직": lines})
codes = [one["로직"] for one in lines if "로직" in one]
write(snapshots.MANIFEST_NAME, {"원본": {**b145._item(key), "경로": ["기슭막이", key]}})
write("단가.json", item_prices.to_json(item_prices.collect(codes, fixed.link_keys(doc))))
for name, data in b145.copy_files(codes, fixed.link_keys(doc)).items(): # 855-F B9-6
write(name, data)
write("일위대가.json", {"줄": doc})
write("입력값.json", b145._values(b145.STONE))