chemprop.featurizers.molgraph.cache#

Classes#

MolGraphCacheFacade

A MolGraphCacheFacade provided an interface for caching

MolGraphCache

A MolGraphCache precomputes the corresponding

MolGraphCacheOnTheFly

A MolGraphCacheOnTheFly computes the corresponding

Module Contents#

class chemprop.featurizers.molgraph.cache.MolGraphCacheFacade(inputs, V_fs, E_fs, featurizer)[source]#

Bases: collections.abc.Sequence[chemprop.data.molgraph.MolGraph], Generic[chemprop.featurizers.base.S]

A MolGraphCacheFacade provided an interface for caching MolGraphs.

Note

This class only provides a facade for a cached dataset, but it does not guarantee whether the underlying data is truly cached.

Parameters:
  • inputs (Iterable[S]) – The inputs to be featurized.

  • V_fs (Iterable[np.ndarray]) – The node features for each input.

  • E_fs (Iterable[np.ndarray]) – The edge features for each input.

  • featurizer (Featurizer[S, MolGraph]) – The featurizer with which to generate the MolGraphs.

class chemprop.featurizers.molgraph.cache.MolGraphCache(inputs, V_fs, E_fs, featurizer, n_workers=0)[source]#

Bases: MolGraphCacheFacade

A MolGraphCache precomputes the corresponding MolGraphs and caches them in memory.

Parameters:
__len__()[source]#
Return type:

int

__getitem__(index)[source]#
Parameters:

index (int)

Return type:

chemprop.data.molgraph.MolGraph

class chemprop.featurizers.molgraph.cache.MolGraphCacheOnTheFly(inputs, V_fs, E_fs, featurizer)[source]#

Bases: MolGraphCacheFacade

A MolGraphCacheOnTheFly computes the corresponding MolGraphs as they are requested.

Parameters:
__len__()[source]#
Return type:

int

__getitem__(index)[source]#
Parameters:

index (int)

Return type:

chemprop.data.molgraph.MolGraph