Example #1
0
def test_can_be_connected_with_single_buffer():
    con_table = np.array([[0, 0, 0, 0, 0], [1, 1, 0, 0, 0], [0, 0, 0, 1, 1],
                          [0, 1, 1, 1, 0], [1, 1, 1, 1, 1]]).T
    assert Hub.can_be_connected_with_single_buffer(con_table)

    con_table = np.array([
        [0, 0, 0, 0, 0],
        [1, 1, 0, 0, 0],
        [0, 0, 0, 1, 1],
        [0, 1, 0, 1, 0],  # < the bad boy
        [0, 1, 1, 1, 0],
        [1, 1, 1, 1, 1]
    ]).T
    assert not Hub.can_be_connected_with_single_buffer(con_table)
Example #2
0
def test_can_be_connected_with_single_buffer():
    con_table = np.array([
        [0, 0, 0, 0, 0],
        [1, 1, 0, 0, 0],
        [0, 0, 0, 1, 1],
        [0, 1, 1, 1, 0],
        [1, 1, 1, 1, 1]]).T
    assert Hub.can_be_connected_with_single_buffer(con_table)

    con_table = np.array([
        [0, 0, 0, 0, 0],
        [1, 1, 0, 0, 0],
        [0, 0, 0, 1, 1],
        [0, 1, 0, 1, 0],  # < the bad boy
        [0, 1, 1, 1, 0],
        [1, 1, 1, 1, 1]]).T
    assert not Hub.can_be_connected_with_single_buffer(con_table)
Example #3
0
def test_col_can_be_connected_with_single_buffer(col, expected):
    assert Hub.can_be_connected_with_single_buffer(
        np.array(col).reshape(-1, 1)) == expected
Example #4
0
def test_col_can_be_connected_with_single_buffer(col, expected):
    assert Hub.can_be_connected_with_single_buffer(np.array(col)
                                                   .reshape(-1, 1)) == expected