コード例 #1
0
ファイル: test_data.py プロジェクト: benfulcher/IDTxl
def test_circular_shift():
    """Test circular shifting of samples."""
    d = Data()
    d.generate_mute_data()
    n = 20
    max_shift = 10
    [perm, shift] = d._circular_shift(n, max_shift)
    assert perm[0] == (n - shift), 'First index after circular shift is wrong!'
    assert shift <= max_shift, 'Actual shift exceeded max_shift.'
    assert perm.shape[0] == n, 'Incorrect length of permuted indices.'
コード例 #2
0
ファイル: test_data.py プロジェクト: SimonStreicher/IDTxl
def test_circular_shift():
    """Test circular shifting of samples."""
    d = Data()
    d.generate_mute_data()
    n = 20
    max_shift = 10
    [perm, shift] = d._circular_shift(n, max_shift)
    assert perm[0] == (n - shift), 'First index after circular shift is wrong!'
    assert shift <= max_shift, 'Actual shift exceeded max_shift.'
    assert perm.shape[0] == n, 'Incorrect length of permuted indices.'