示例#1
0
文件: test_utils.py 项目: roijo/pyphi
def test_comb_indices():
    n, k = 3, 2
    data = np.arange(6).reshape(2, 3)
    assert np.array_equal(data[:, utils.comb_indices(n, k)],
                          np.asarray([[[0, 1],
                                       [0, 2],
                                       [1, 2]],
                                      [[3, 4],
                                       [3, 5],
                                       [4, 5]]]))
示例#2
0
def test_comb_indices():
    n, k = 3, 2
    data = np.arange(6).reshape(2, 3)
    # fmt: off
    answer = np.array([
        [[0, 1], [0, 2], [1, 2]],
        [[3, 4], [3, 5], [4, 5]],
    ])
    # fmt: on
    assert np.array_equal(data[:, utils.comb_indices(n, k)], answer)
示例#3
0
def test_comb_indices():
    n, k = 3, 2
    data = np.arange(6).reshape(2, 3)
    assert np.array_equal(
        data[:, utils.comb_indices(n, k)],
        np.asarray([[[0, 1], [0, 2], [1, 2]], [[3, 4], [3, 5], [4, 5]]]))