Support per-sample Delta-E references via NAME > REF

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-23 09:33:52 +03:30
parent bb6e6d9b64
commit f7e3731724
6 changed files with 108 additions and 78 deletions

View File

@@ -17,13 +17,13 @@ RESET = "\033[0m"
def load_sample_names(path: Path) -> list[str]:
# A leading "*" marks the Delta-E reference sample; strip it to get the name.
# Optional "NAME > REF": keep only the sample name (before ">").
names = []
for line in path.read_text(encoding="utf-8").splitlines():
line = line.strip()
if line and not line.startswith("#"):
if line.startswith("*"):
line = line[1:].strip()
if ">" in line:
line = line.split(">", 1)[0].strip()
names.append(line)
return names