From a6b17316d00b31b0ec9df6ab813840dd4181d52d Mon Sep 17 00:00:00 2001 From: Peter Kroon Date: Wed, 20 Sep 2023 13:52:23 +0200 Subject: [PATCH] Write Processor docs --- doc/source/processors.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/source/processors.rst b/doc/source/processors.rst index 3ca9a69fc..e53c0425a 100644 --- a/doc/source/processors.rst +++ b/doc/source/processors.rst @@ -1,2 +1,18 @@ Processor ========= +:class:`Processors ` are relatively +simple. They form the fundamental steps of the martinize2 pipeline. Processors +are called via their :meth:`~vermouth.processors.processor.Processor.run_system` +method. The default implementation of this method iterates over the molecules +in the system, and runs the :meth:`~vermouth.processors.processor.Processor.run_molecule` +method on them. This means that implementations of Processors must implement +either a ``run_system`` method, or a ``run_molecule`` method. If the processor +can be run on independent molecules the ``run_molecule`` method is preferred; +``run_system`` should be used only for cases where the problem at hand cannot +be separated in tasks-per-molecule. + +In their ``run_molecule`` method Processor implementations are free to either +modify :class:`molecules ` or create new ones. +Either way, they must return a :class:`~vermouth.molecule.Molecule`. The +``run_system`` will be called with a :class:`~vermouth.system.System`, which +will be modified in place.