Skip to content

Commit

Permalink
Merge branch 'main' into add_unknown_cluster_type
Browse files Browse the repository at this point in the history
  • Loading branch information
misko authored Feb 27, 2025
2 parents 1c6832d + f57ec7e commit f9a7784
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/fairchem/core/datasets/ase_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,23 +471,23 @@ class AseDBDataset(AseAtomsDataset):
def _load_dataset_get_ids(self, config: dict) -> list[int]:
if isinstance(config["src"], list):
filepaths = []
for path in config["src"]:
for path in sorted(config["src"]):
if os.path.isdir(path):
filepaths.extend(glob(f"{path}/*"))
filepaths.extend(sorted(glob(f"{path}/*")))
elif os.path.isfile(path):
filepaths.append(path)
else:
raise RuntimeError(f"Error reading dataset in {path}!")
elif os.path.isfile(config["src"]):
filepaths = [config["src"]]
elif os.path.isdir(config["src"]):
filepaths = glob(f'{config["src"]}/*')
filepaths = sorted(glob(f'{config["src"]}/*'))
else:
filepaths = glob(config["src"])
filepaths = sorted(glob(config["src"]))

self.dbs = []

for path in sorted(filepaths):
for path in filepaths:
try:
self.dbs.append(self.connect_db(path, config.get("connect_args", {})))
except ValueError:
Expand Down

0 comments on commit f9a7784

Please sign in to comment.