molfoundry.ApplyMode#

class molfoundry.ApplyMode(*values)#

Bases: Enum

Which graphs a rule application may use, given the list of graphs it is applied to.

Selects how DG.Builder.apply(), DG.Builder.applyPartialMatch(), Rule.numMatches() and Rule.matches() read that list (Rule.matches() only the two modes without further copies):

  • UseAll (default): use all listed graphs. Each takes part in every derivation, exactly once; each listing is one copy, so a graph listed twice (or two identical graphs) is two copies, and no further copy is added. This is MØD’s apply(..., onlyProper=True).

  • UseAny: use any of the listed graphs. A derivation may take any of them, each at most once; each listing is one copy and no further copy is added. This is MØD’s apply(..., onlyProper=False).

  • UseAnyMultiplicity: use any of the listed graphs in any multiplicity. A derivation may take any of them, each in as many copies as it needs, as a rule strategy uses its graphs.

UseAll = 'use-all'#
UseAny = 'use-any'#
UseAnyMultiplicity = 'use-any-multiplicity'#