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 b2e2625 commit 48b3320
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 48b3320

Please sign in to comment.