コード例 #1
0
ファイル: molecular_graphs.py プロジェクト: yychuang/molmod
 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
ファイル: psf.py プロジェクト: teoliphant/molmod
 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
ファイル: psf.py プロジェクト: pengfeili1/Molmodsummer
 def get_graph(self):
     return Graph(self.bonds)