molfoundry.DG#
- class molfoundry.DG(labelSettings=LabelSettings(LabelType.String, LabelRelation.Isomorphism), graphDatabase=[])[source]#
Bases:
TSObject- property labelSettings: LabelSettings#
- print(printer=None, data=None)[source]#
Emit a static SVG visualization of the derivation graph.
Every DG vertex renders as an oval-framed molecule depiction (produced by the shared GraphSVGDrawer, in the mode / collapse-H setting picked up from printer) with the graph’s name captioned inside the oval. Every hyperedge with a single source and a single target collapses to a direct arrow labeled with e{id}; every multi-educt or multi-product hyperedge gets a small labeled square “junction” node with arrows from the educts into the junction and from the junction to the products.
Node positions come from a force-directed layout so junctions settle between their attached molecules; each oval’s dimensions match the aspect ratio of its molecule SVG’s viewBox so nothing gets stretched.
Everything is one inline SVG, so the dynamic light/dark theme follows the outer page’s [data-bs-theme] via CSS without needing any JavaScript.
- Parameters:
printer (GraphPrinter | None)
data (DGPrintData | None)
- class HyperEdge[source]#
Bases:
TSObject- print(printer=None)[source]#
- Parameters:
printer (GraphPrinter | None)
- class Builder(dg)[source]#
Bases:
TSObject- Parameters:
dg (DG)
- execute(strategy, verbosity=2, ignoreRuleLabelTypes=False)[source]#
- Parameters:
strategy (DGStrat) – The strategy to execute
verbosity (int) –
The verbosity defaults to level 2. The levels have the following meaning:
0 (or less): no information is printed.
2: Repetition strategies print information for each round.
4: All strategies print minimal information.
6: Derivation predicate strategies and filtering strategies also print their predicates.
8: Rule strategies print minimal information about graph binding.
10: Rule strategies print more information about graph binding, including failure due to derivation predicates.
50: Print information about morphism generation for rule composition.
60: Print rule composition information.
ignoreRuleLabelTypes – Whether rules in the strategy should be checked beforehand for whether they have an associated LabelType which matches the one in the underlying derivation graph.
- Return type:
- addDerivation(d)[source]#
- Parameters:
d (Derivations)
- Return type: