Skip to content

Commit

Permalink
Do not rely on order of files of os.walk
Browse files Browse the repository at this point in the history
RNG is seeded but order could change from run to run causing
irreproducible results
  • Loading branch information
yarikoptic committed Sep 28, 2023
1 parent d6dd3c7 commit a23088d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions launch_parser_on_nidm.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def main():
context_write.write("Processing files...\n")

# Iteration on each example
for root, _, files in os.walk(opt.input_dir):
for file in files:
for root, _, files in sorted(os.walk(opt.input_dir)):
for file in sorted(files):

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

0 comments on commit a23088d

Please sign in to comment.