fix: load conjugations from cache when --skip-conjugations passed

Previously --skip-conjugations returned None, causing build_all_variants()
to produce near-empty conjugation decks (0.3MB font-only files). Now loads
from conjugations.json cache so all 6 release variants build correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Sochen 2026-03-05 21:01:47 +00:00
parent ccd7d61efb
commit 3fc3a21a33

19
run.py
View file

@ -382,9 +382,20 @@ def step_build_all(args, examples_cache: dict, freq_cache: dict, conjugations: d
def step_conjugations(args):
"""Step 6 — extract conjugations (returns data; building handled by step_build_all)."""
"""Step 6 — extract conjugations (returns data; building handled by step_build_all).
--skip-conjugations skips re-extraction from pealim.com but still loads
from cache so conj deck variants are built correctly.
"""
conj_cache = DATA_DIR / "conjugations.json"
if args.skip_conjugations:
logger.info("[6] Skipping conjugations (--skip-conjugations)")
if conj_cache.exists():
logger.info("[6] --skip-conjugations: loading from cache …")
with open(conj_cache) as f:
import json as _json
return _json.load(f)
logger.info("[6] --skip-conjugations: no cache found, skipping conj decks")
return None
verbs_file = Path(__file__).parent / "verbs_input.txt"
@ -392,9 +403,7 @@ def step_conjugations(args):
logger.info("[6] verbs_input.txt not found — skipping conjugation deck")
return None
# Use cached conjugations.json if available (skip re-extraction)
conj_cache = DATA_DIR / "conjugations.json"
if conj_cache.exists() and not getattr(args, 'refresh_conjugations', False):
if conj_cache.exists():
logger.info("[6] Using cached conjugations.json …")
with open(conj_cache) as f:
import json as _json