TRuML utility functions (truml.utils
)¶
Miscellaneous support functions
-
truml.utils.
build_adj_list
(mols)¶ Builds an adjacency list from a list of molecules
mols : list of Molecule instances
Adjacency list
-
truml.utils.
dfs
(al, m, v)¶ Depth first search (recursive)
al : Adjacency list m : Node list v : Current node index
None
-
truml.utils.
flatten_pattern
(cps)¶ Flattens a CPatternList into a list of Molecules
-
truml.utils.
flatten_pattern_todict
(cps)¶ Builds a dict where Molecule indices in a flattened CPatternList map to the CPattern indices in the CPatternList
-
truml.utils.
get_connected_components
(mols)¶ Determines explicitly connected components in a list of molecules
mols : list of Molecule instances
list of list of Molecule instances