Utils#

Various utility tools that do not easily fit into other modules.


Validators:

ensure_mols

Ensure that all input sequence elements are RDKit Mol objects.

ensure_smiles

Ensure that all input sequence elements are SMILES strings.

require_mols

Check that all inputs are RDKit Mol objects, raises ValueError otherwise.

require_mols_with_conf_ids

Check that all inputs are RDKit Mol objects with "conf_id" property set, i.e. with conformers computed and properly identified.

require_strings

Check that all inputs are strings, raises ValueError otherwise.

Utilities:

get_data_from_indices

Retrieve elements from data at specified indices.

no_rdkit_logs

Context manager that disables RDKit logging.

run_in_parallel

Run a function in parallel on provided data in batches, using joblib.