Skip to content

Commit

Permalink
Write Processor docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pckroon committed Sep 20, 2023
1 parent 4d6c6e7 commit a6b1731
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/source/processors.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
Processor
=========
:class:`Processors <vermouth.processors.processor.Processor>` 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 <vermouth.molecule.Molecule>` 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.

0 comments on commit a6b1731

Please sign in to comment.