rxn.chemutils.tokenization.file_is_tokenized

rxn.chemutils.tokenization.file_is_tokenized(filepath)[source]

Whether a file contains tokenized SMILES or not.

By default, this looks at the first non-empty line of the file only!

Raises
  • TokenizationError – propagated from tokenize_smiles()

  • RuntimeError – for empty files or files with empty lines only.

Parameters

filepath (Union[str, PathLike]) – path to the file.

Return type

bool