We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97839d9 commit c029395Copy full SHA for c029395
chebai/preprocessing/reader.py
@@ -203,10 +203,13 @@ def _read_data(self, raw_data: str) -> List[int]:
203
print(f"RDKit failed to process {raw_data}")
204
print(f"\t{e}")
205
try:
206
+ mol = Chem.MolFromSmiles(raw_data.strip())
207
+ if mol is None:
208
+ raise ValueError(f"Invalid SMILES: {raw_data}")
209
return [self._get_token_index(v[1]) for v in _tokenize(raw_data)]
210
except ValueError as e:
211
print(f"could not process {raw_data}")
- print(f"\t{e}")
212
+ print(f"\tError: {e}")
213
return None
214
215
0 commit comments