chemprop.featurizers.molgraph.cache
===================================

.. py:module:: chemprop.featurizers.molgraph.cache


Classes
-------

.. autoapisummary::

   chemprop.featurizers.molgraph.cache.MolGraphCacheFacade
   chemprop.featurizers.molgraph.cache.MolGraphCache
   chemprop.featurizers.molgraph.cache.MolGraphCacheOnTheFly


Module Contents
---------------

.. py:class:: MolGraphCacheFacade(inputs, V_fs, E_fs, featurizer)

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


   A :class:`MolGraphCacheFacade` provided an interface for caching
   :class:`~chemprop.data.molgraph.MolGraph`\s.

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


   :param inputs: The inputs to be featurized.
   :type inputs: Iterable[S]
   :param V_fs: The node features for each input.
   :type V_fs: Iterable[np.ndarray]
   :param E_fs: The edge features for each input.
   :type E_fs: Iterable[np.ndarray]
   :param featurizer: The featurizer with which to generate the
                      :class:`~chemprop.data.molgraph.MolGraph`\s.
   :type featurizer: Featurizer[S, MolGraph]


.. py:class:: MolGraphCache(inputs, V_fs, E_fs, featurizer, n_workers = 0)

   Bases: :py:obj:`MolGraphCacheFacade`


   A :class:`MolGraphCache` precomputes the corresponding
   :class:`~chemprop.data.molgraph.MolGraph`\s and caches them in memory.


   .. py:method:: __len__()


   .. py:method:: __getitem__(index)


.. py:class:: MolGraphCacheOnTheFly(inputs, V_fs, E_fs, featurizer)

   Bases: :py:obj:`MolGraphCacheFacade`


   A :class:`MolGraphCacheOnTheFly` computes the corresponding
   :class:`~chemprop.data.molgraph.MolGraph`\s as they are requested.


   .. py:method:: __len__()


   .. py:method:: __getitem__(index)


