Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/rev/1785e40b2a2d
Дата изменения: Unknown
Дата индексирования: Tue Oct 2 00:49:47 2012
Кодировка:
allpy: 1785e40b2a2d

allpy

changeset 520:1785e40b2a2d

blocks3d(): add primary_cliques parameter if primary_cliques parameter is set, blocks3d() returns self-overlapping raw cliques (as blocks) instead of set of self-non-overlapping blocks (default) it could be used for debugging and testing
author boris (kodomo) <bnagaev@gmail.com>
date Sat, 26 Feb 2011 18:05:10 +0300
parents c19216f2d7b4
children a3df15a42f9d
files allpy/structure.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/allpy/structure.py	Fri Feb 25 18:00:20 2011 +0300
     1.2 +++ b/allpy/structure.py	Sat Feb 26 18:05:10 2011 +0300
     1.3 @@ -242,13 +242,15 @@
     1.4  
     1.5      def blocks3d(self, max_delta=config.delta,
     1.6      timeout=config.timeout, timeout_2=config.timeout_2,
     1.7 -    min_width=config.min_width):
     1.8 +    min_width=config.min_width, primary_cliques=False):
     1.9          """ Returns length-sorted list of reliable blocks
    1.10  
    1.11          * max_delta -- threshold of distance spreading
    1.12          * timeout -- Bron-Kerbosh timeout (couple cores)
    1.13          * timeout_2 -- Bron-Kerbosh timeout (blocks)
    1.14          * min_width -- min width of each core
    1.15 +        * primary_cliques -- if True, return cliques
    1.16 +            instead of not-self-intersected blocks
    1.17          """
    1.18          result = []
    1.19          Block = self.__class__
    1.20 @@ -312,6 +314,8 @@
    1.21              return cmp(width1, width2)
    1.22          # sort blocks
    1.23          clique_blocks.sort(cmp=cmp_blocks, reverse=True)
    1.24 +        if primary_cliques:
    1.25 +            return clique_blocks
    1.26          used_monomers = set()
    1.27          for clique_block in clique_blocks:
    1.28              monomers = set(clique_block.monomers())