brainstorm/structure/layout.py
def can_be_connected_with_single_buffer(connection_table):
        """
        Check for a connection table if it represents a layout that can be
        realized by a single buffer.

        This means checking if in every column of the table all the ones form a
        connected block.

        Args:
            connection_table (array_like):
                2d array of zeros and ones representing the connectivity
                between inputs and outputs of a hub.

        Returns:
            bool
        """
        padded = np.zeros((connection_table.shape[0] + 2,
                           connection_table.shape[1]))
        padded[1:-1, :] = connection_table
        return np.all(np.abs(np.diff(padded, axis=0)).sum(axis=0) <= 2)

        Check for a connection table if it represents a layout that can be
        realized by a single buffer.

        This means checking if in every column of the table all the ones form a
        connected block.

        Args:
            connection_table (array_like):
                2d array of zeros and ones representing the connectivity
                between inputs and outputs of a hub.

        Returns:
            bool
        
Check for a connection table if it represents a layout that can be
realized by a single buffer.

This means checking if in every column of the table all the ones form a
connected block.
Check for a connection table if it represents a layout that can be realized by a single buffer . This means checking if in every column of the table all the ones form a connected block .
def can_be_connected_with_single_buffer(connection_table):
        padded = np.zeros((connection_table.shape[0] + 2,
                           connection_table.shape[1]))
        padded[1:-1, :] = connection_table
        return np.all(np.abs(np.diff(padded, axis=0)).sum(axis=0) <= 2)
def can_be_connected_with_single_buffer ( connection_table ) : padded = np . zeros ( ( connection_table . shape [ 0 ] + 2 , connection_table . shape [ 1 ] ) ) padded [ 1 : - 1 , : ] = connection_table return np . all ( np . abs ( np . diff ( padded , axis = 0 ) ) . sum ( axis = 0 ) <= 2 )
Check for a connection table if it represents a layout that can be
realized by a single buffer.
Check for a connection table if it represents a layout that can be realized by a single buffer .
"""
        Check for a connection table if it represents a layout that can be
        realized by a single buffer.

        This means checking if in every column of the table all the ones form a
        connected block.

        Args:
            connection_table (array_like):
                2d array of zeros and ones representing the connectivity
                between inputs and outputs of a hub.

        Returns:
            bool
        """
None
connection_table
2d array of zeros and ones representing the connectivity
between inputs and outputs of a hub.
2d array of zeros and ones representing the connectivity between inputs and outputs of a hub .