Skip to content

Commit 3178fed

Browse files
ryan-williamsclaude
andcommitted
Fix trailing-newline bug: RhoData treats blank lines as sample IDs
`RhoData.member_list` includes empty strings from trailing newlines in filelists, causing `FileNotFoundError: .CHGCAR`. Write filelist without trailing newline. Always use temp data root (even for all samples) to ensure clean filelist. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5214112 commit 3178fed

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

modal/benchmark.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,19 @@ def run_benchmark(
110110
samples = len(subset)
111111
log.info("Using all %d eligible samples", samples)
112112

113-
# Create temp data root with symlinks + custom filelist
113+
if not subset:
114+
raise ValueError(
115+
f"No eligible samples (total={len(all_ids)}, max_file_size={max_file_size}MB)"
116+
)
117+
118+
# Create temp data root with symlinks + clean filelist (no trailing newline)
114119
data_root = "/tmp/benchmark_data"
115120
Path(data_root).mkdir(parents=True, exist_ok=True)
116121
for subdir in ["data", "label"]:
117122
link = Path(data_root) / subdir
118123
if not link.exists():
119124
link.symlink_to(Path(DATA_ROOT) / subdir)
120-
Path(data_root, "mp_filelist.txt").write_text("\n".join(subset) + "\n")
125+
Path(data_root, "mp_filelist.txt").write_text("\n".join(subset))
121126

122127
log.info(
123128
"Benchmark: gpu=%s, epochs=%d, channels=%d, blocks=%d, samples=%d",

0 commit comments

Comments
 (0)