Transpose

This commit is contained in:
khodowany
2026-09-16 21:33:34 -05:00
parent c6adff8b3c
commit 01c6d4e786
14 changed files with 526 additions and 50 deletions
+5 -13
View File
@@ -88,20 +88,12 @@ def validate_expected_performance_summary(expected_path: Path, generated_songs_d
def validate_practice_variants(generated_practice_dir: Path) -> None:
if not generated_practice_dir.exists():
return
melody_root = generated_practice_dir / "melody"
if melody_root.exists():
expected_names = {key.lower().replace("#", "sharp").replace("b", "b") + ".json" for key in TARGET_KEYS}
for exercise_dir in sorted(path for path in melody_root.rglob("*") if path.is_dir()):
expected_names = {key.lower().replace("#", "sharp") + ".json" for key in TARGET_KEYS}
for practice_type in ('melody', 'chord'):
root = generated_practice_dir / practice_type
for exercise_dir in sorted(path for path in root.rglob("*") if path.is_dir()):
json_names = {path.name for path in exercise_dir.glob("*.json")}
if not json_names:
continue
if json_names != expected_names:
raise ValueError(f"melody practice generator drift in {exercise_dir}: expected {sorted(expected_names)}, found {sorted(json_names)}")
chord_root = generated_practice_dir / "chord"
if chord_root.exists():
for exercise_dir in sorted(path for path in chord_root.rglob("*") if path.is_dir()):
json_names = [path.name for path in exercise_dir.glob("*.json")]
if not json_names:
continue
if len(json_names) != 1:
raise ValueError(f"chord practice generator drift in {exercise_dir}: expected one authored-key variant, found {json_names}")
raise ValueError(f"{practice_type} practice generator drift in {exercise_dir}: expected {sorted(expected_names)}, found {sorted(json_names)}")