stk.ReactionFactory
- class stk.ReactionFactory[source]
Bases:
objectAn abstract base class for reaction factories.
Reaction factories are responsible for creating
Reactioninstances. Different subclasses of this class will provide different options for creatingReactioninstances.If you want to change which reactions are used to create and delete atoms and bonds during
ConstructedMoleculeconstruction, you want to subclass this abstract base class and implementget_reaction(). Your implementation can then pick which reaction to use for a particularEdgeGroup. You will then pass an instance of yourReactionFactorysubclass to theTopologyGraphinitializer, so that it knows to use it.Examples
Subclass Implementation
The source code of the subclasses, listed in
reaction_factory, can serve as good examples.Methods
Get a reaction to use on the edge_group.
- get_reaction(construction_state, edge_group)[source]
Get a reaction to use on the edge_group.
- Parameters:
construction_state (
ConstructionState) – The state of the current construction.edge_group (
EdgeGroup) – The edge group for which a reaction should be found.
- Returns:
The reaction to use on the edge_group.
- Return type: