Merge remote-tracking branch 'origin/sub_laptop_4' into main_desktop_1

This commit is contained in:
2026-09-19 18:20:11 +09:00
6 changed files with 602 additions and 7 deletions
+1 -1
View File
@@ -25,7 +25,7 @@
- `rows` 는 요소·로직 파일은 `줄`, 표형 파일(소요량·계수)은 `표` 를 줄로 봄.
- `q` = 이름 찾기 — `열쇠`·`이름` 에 든 글(대소문자 무시).
- `chapter` = 파일 이름의 장(`13장` · `01장`) · 없으면 "".
- `chapter` = 파일 이름의 장(`공통3장` · `13장` · `01장`) · 없으면 "".
- `blocked` = 로직 검사(`check_master.py 로직`)에 걸림 · `reasons` = 걸린 까닭 글.
## 3. 시험 계산
+22 -6
View File
@@ -59,10 +59,10 @@ ROW_KEYS = {
}
def load(names: list[str] | None = None) -> dict[str, dict]:
"""첫 층 JSON 모두(밑줄 파일 빼고) — 수는 Decimal."""
def load(names: list[str] | None = None, folder: Path = MASTER) -> dict[str, dict]:
"""첫 층 JSON 모두(밑줄 파일 빼고) — 수는 Decimal. `folder` = 마스터 폴더(M01 시험은 사본)."""
out = {}
for path in sorted(MASTER.glob("*.json")):
for path in sorted(Path(folder).glob("*.json")):
if path.name.startswith("_") or (
names and path.name not in names and path.stem not in names
):
@@ -73,8 +73,19 @@ def load(names: list[str] | None = None) -> dict[str, dict]:
return out
def master() -> mf.Master:
return mf.Master(load())
def master(folder: Path = MASTER) -> mf.Master:
return mf.Master(load(folder=folder))
def check_saved(files: dict[str, dict], changed: list[str]) -> list[str]:
"""저장 전 검사(M01) — 고친 파일의 틀 + 모든 로직의 변수. `files` = 폴더 전부(고친 뒤)."""
out = [x for name in changed for x in check_form(name, files[name])]
return out + check_logics(files, mf.Master(files))
def calc(files: dict[str, dict], ref: str, given: dict) -> dict:
"""시험 계산(M01) — `ref` = 「원문:로직 열쇠」 · 멈추면 FormulaError."""
return mf.run(mf.Master(files), ref, given)
# ── (1) 틀 ────────────────────────────────────────────────────────────
@@ -228,7 +239,12 @@ def check_body(files: dict[str, dict]) -> list[str]:
if not text:
out.append(f"{where} · 본문 절 못 찾음 「{table.get('출처')}」")
continue
mine = _flat(table.get("줄")) | _flat(table.get("기준")) | _flat(table.get("주")) | _flat(table.get("값칸"))
mine = (
_flat(table.get("줄"))
| _flat(table.get("기준"))
| _flat(table.get("주"))
| _flat(table.get("값칸"))
)
fake = mine - numbers_in(text)
if fake:
out.append(f"{where} · 허구 {len(fake)} {sorted(fake, key=Decimal)}")