Skip to content

Commit e615d02

Browse files
sorted fix as mentioned in #212
1 parent 8ed2756 commit e615d02

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

detectree2/models/train.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -824,10 +824,10 @@ def combine_dicts(root_dir: str,
824824
Returns:
825825
List of combined dictionaries from the specified directories.
826826
"""
827-
# Get the list of directories within the root directory
828-
train_dirs = [
827+
# Get the list of directories within the root directory, sorted alphabetically
828+
train_dirs = sorted([
829829
os.path.join(root_dir, dir) for dir in os.listdir(root_dir) if os.path.isdir(os.path.join(root_dir, dir))
830-
]
830+
])
831831
# Handle the different modes for combining dictionaries
832832
if mode == "train":
833833
# Exclude the validation directory from the list of directories

0 commit comments

Comments
 (0)