Skip to content

Commit b629f9c

Browse files
committed
catch mol processing errors
1 parent a50ce8f commit b629f9c

File tree

1 file changed

+7
-1
lines changed
  • chebai_graph/preprocessing/datasets

1 file changed

+7
-1
lines changed

chebai_graph/preprocessing/datasets/chebi.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,13 @@ def enc_if_not_none(encode, value):
130130

131131
# augment molecule graph if possible (this would also happen for the properties if needed, but this avoids redundancy)
132132
if isinstance(self.reader, _AugmentorReader):
133-
returned_results = [self.reader._create_augmented_graph(mol) for mol in features]
133+
returned_results = []
134+
for mol in features:
135+
try:
136+
r = self.reader._create_augmented_graph(mol)
137+
except Exception as e:
138+
r = None
139+
returned_results.append(r)
134140
mols = [augmented_mol[1] for augmented_mol in returned_results if augmented_mol is not None]
135141
else:
136142
mols = features

0 commit comments

Comments
 (0)