Skip to content

Commit a23088d

Browse files
committed
Do not rely on order of files of os.walk
RNG is seeded but order could change from run to run causing irreproducible results
1 parent d6dd3c7 commit a23088d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

launch_parser_on_nidm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ def main():
8181
context_write.write("Processing files...\n")
8282

8383
# Iteration on each example
84-
for root, _, files in os.walk(opt.input_dir):
85-
for file in files:
84+
for root, _, files in sorted(os.walk(opt.input_dir)):
85+
for file in sorted(files):
8686

8787
if file.endswith("batch.m"): # spm
8888
filename_ss_ext = file.split(".m")[0]

0 commit comments

Comments
 (0)