brainstorm/structure/layout.py
def permute_rows(self):
        """
        Given a list of sources and a connection table, find a permutation of
        the sources, such that they can be connected to the sinks via a single
        buffer.
        """
        # systematically try all permutations until one satisfies the condition
        for perm in itertools.permutations(self.nesting):
            self.perm = list(flatten(perm))
            ct = np.atleast_2d(self.connection_table[self.perm])
            if Hub.can_be_connected_with_single_buffer(ct):
                self.connection_table = ct
                self.flat_sources = [self.flat_sources[i] for i in self.perm]
                return

        raise NetworkValidationError("Failed to lay out buffers. "
                                     "Please change connectivity.")

        Given a list of sources and a connection table, find a permutation of
        the sources, such that they can be connected to the sinks via a single
        buffer.
        
Given a list of sources and a connection table, find a permutation of
the sources, such that they can be connected to the sinks via a single
buffer.
Given a list of sources and a connection table find a permutation of the sources such that they can be connected to the sinks via a single buffer .
def permute_rows(self):
        for perm in itertools.permutations(self.nesting):
            self.perm = list(flatten(perm))
            ct = np.atleast_2d(self.connection_table[self.perm])
            if Hub.can_be_connected_with_single_buffer(ct):
                self.connection_table = ct
                self.flat_sources = [self.flat_sources[i] for i in self.perm]
                return
        raise NetworkValidationError("Failed to lay out buffers. "
                                     "Please change connectivity.")
def permute_rows ( self ) : for perm in itertools . permutations ( self . nesting ) : self . perm = list ( flatten ( perm ) ) ct = np . atleast_2d ( self . connection_table [ self . perm ] ) if Hub . can_be_connected_with_single_buffer ( ct ) : self . connection_table = ct self . flat_sources = [ self . flat_sources [ i ] for i in self . perm ] return raise NetworkValidationError ( "Failed to lay out buffers. " "Please change connectivity." )
Given a list of sources and a connection table, find a permutation of
the sources, such that they can be connected to the sinks via a single
buffer.
Given a list of sources and a connection table find a permutation of the sources such that they can be connected to the sinks via a single buffer .
"""
        Given a list of sources and a connection table, find a permutation of
        the sources, such that they can be connected to the sinks via a single
        buffer.
        """ # systematically try all permutations until one satisfies the condition
self