Skip to content

Commit d54b794

Browse files
opxrd: Excluded files as databases in ._as_database_list
1 parent 86d1728 commit d54b794

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

opxrd/wrapper/opxrd.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ def as_database_list(cls, root_dirpath : str, download : bool = True, download_i
3131

3232
pattern_dbs = []
3333
print(f'- Loading databases from {root_dirpath}')
34-
for d in os.listdir(path=root_dirpath):
35-
dirpath = os.path.join(root_dirpath, d)
34+
dirpaths = [f.path for f in os.scandir(root_dirpath) if f.is_dir()]
35+
for d in dirpaths:
3636
time.sleep(0.01)
37-
db = PatternDB.load(dirpath=dirpath, strict=True)
37+
db = PatternDB.load(dirpath=d, strict=True)
3838
db.name = d
3939

4040
pattern_dbs.append(db)

0 commit comments

Comments
 (0)