Пример #1
0
 def __init__(self, criteria_sets=None, vertex_tags=None):
     """
        Arguments: see :class:`molmod.graphs.CustomPattern`
     """
     if vertex_tags is None:
         vertex_tags = {}
     pattern_graph = Graph([(0, 1), (0, 2), (0, 3), (0, 4)])
     CustomPattern.__init__(self, pattern_graph, criteria_sets, vertex_tags)
Пример #2
0
 def __init__(self, size, criteria_sets=None, vertex_tags=None, strong=False):
     """
        Argument:
         | ``size``  --  the size of the ring
     """
     if vertex_tags is None:
         vertex_tags = {}
     self.size = size
     self.strong = strong
     pattern_graph = Graph([(i, (i+1)%size) for i in range(size)])
     CustomPattern.__init__(self, pattern_graph, criteria_sets, vertex_tags)
Пример #3
0
        def make_graph_distance_matrix(system):
            """Return a bond graph distance matrix.

            Parameters
            ----------
            system : System
                Molecule (with bonds) for which the graph distances must be computed.

            The graph distance is used for comparison because it allows the pattern
            matching to make optimal choices of which pairs of atoms to compare next, i.e.
            both bonded or nearby the last matched pair.
            """
            from molmod.graphs import Graph
            return Graph(system.bonds, system.natom).distances
Пример #4
0
 def get_graph(self):
     """Return the bond graph represented by the data structure"""
     return Graph(self.bonds)
Пример #5
0
 def __init__(self, size, criteria_sets=None, node_tags={}, strong=False):
     self.size = size
     self.strong = strong
     subgraph = Graph([(i,(i+1)%size) for i in xrange(size)])
     SubgraphPattern.__init__(self, subgraph, criteria_sets, node_tags)
Пример #6
0
 def __init__(self, criteria_sets=None, node_tags={}):
     subgraph = Graph([(0, 1), (0, 2), (0, 3), (0, 4)])
     SubgraphPattern.__init__(self, subgraph, criteria_sets, node_tags)
Пример #7
0
 def get_graph(self):
     return Graph(self.bonds)