feat(712-2): 단위 한 벌 master_unit — 별칭 · 개수 묶음 · 결과단위 배 읽기 · 같은 성격 환산 · 근거 글

- 별칭(master_material) · 같은 성격 환산(master_pick) · 결과단위 배 읽기 셋(Store_Combo · Hopyo_Ours · master_basis) · 보이는 꼴 별칭(master_basis) 갈아 끼움 · 엑셀 맞춤(Hopyo_Match)은 master_pick 이름 그대로 이음
- 개수 묶음(개 · EA · 본 · 매) 1:1 — 본 ↔ 개 단위경고 4 줄 사라짐 · 값 같음
- 부피 ↔ 무게 = 단위중량 표 CC000337 고른 줄 받을 때만(기본 줄 없음) · 밀도 · ㎾h 경고 글만
- B08 /1000 · /40 손 식 = 실무 엑셀 G열 식이라 그대로(시험이 같은 값 대조)
- 지킴 시험 test_712_2_unit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-01 16:03:54 +09:00
co-authored by Claude Opus 5.5
parent 6d5b78f83e
commit 881c204ca8
7 changed files with 195 additions and 49 deletions
+5 -7
View File
@@ -17,6 +17,7 @@ from config import config_system
from M01_MasterData import M01_MasterData_Store as store
cm, mk, mcb = store.cm, store.mk, store.mcb
import master_unit as mu # noqa: E402 — `store` 가 scripts 를 길에 둔 뒤(712-2)
FILE = mcb.FILE
OWNERS = mcb.OWNERS
@@ -150,9 +151,6 @@ def combo(key: str) -> dict:
}
_PER = re.compile(
r"원\s*/\s*(\d[\d,]*\.?\d*|\.\d+)?\s*([^\s·(\d,.][^\s·(]*)"
) # 「원/1,000본」 = 배 1000
_TAIL = re.compile(r"\s*\([^()]*\)\s*$")
@@ -177,7 +175,7 @@ def combo_pills(row: dict) -> dict:
got = whole.logic(code)
except cm.mf.FormulaError:
continue
per = _PER.findall(str(got.get("결과단위") or ""))
per = mu.per(got.get("결과단위")) # 결과단위 배 읽기 한 벌(712-2)
if not per:
continue
# ponytail: 분모가 여럿(「원/㎡ · 원/㎥(단위당 따름)」)이면 「㎡ · ㎥」 한 글 — 입력이 고름
@@ -187,9 +185,9 @@ def combo_pills(row: dict) -> dict:
(name, unit), {"키": f"{name}|{unit}", "이름": name, "단위": unit, "로직": []}
)
pill["로직"].append(code)
times = per[0][0].replace(",", "")
if len(per) == 1 and times and float(times) != 1:
pill["배"] = float(times) if "." in times else int(times)
times = per[0][0]
if len(per) == 1 and times != 1:
pill["배"] = int(times) if times == times.to_integral_value() else float(times)
return {"키": row.get("키"), "이름": row.get("이름"), "물량": list(pills.values()), "조건": []}