示例#1
0
def test_repeatAndVarySequence_fail_inputlength2(protosequence1):
    poss = (1, 2)
    channels = [1, 1]
    names = ['ramp', 'ramp']
    args = ['start', 'stop']
    iters = [(1, 0.2, 0.3), (1, 0.2)]

    with pytest.raises(ValueError):
        repeatAndVarySequence(protosequence1, poss, channels, names, args,
                              iters)
示例#2
0
def test_repeatAndVarySequence_fail_consistency(protosequence1,
                                                squarepulse_baseelem):

    protosequence1.addElement(5, squarepulse_baseelem)

    print(protosequence1.checkConsistency())

    poss = (1, )
    channels = [1]
    names = ['ramp']
    args = ['start']
    iters = [(1, 0.2, 0.3)]

    with pytest.raises(SequenceConsistencyError):
        repeatAndVarySequence(protosequence1, poss, channels, names, args,
                              iters)
示例#3
0
def test_repeatAndVarySequence_same_elements(protosequence1, pos):
    poss = (1, )
    channels = [1]
    names = ['ramp']
    args = ['start']
    iters = [(1, 0.2, 0.3)]

    newseq = repeatAndVarySequence(protosequence1, poss, channels, names, args,
                                   iters)
    assert newseq.element(pos) == protosequence1.element(2)
示例#4
0
def test_repeatAndVarySequence_awgspecs(protosequence1):
    poss = (1, )
    channels = [1]
    names = ['ramp']
    args = ['stop']
    iters = [[1, 0.9, 0.8]]

    newseq = repeatAndVarySequence(protosequence1, poss, channels, names, args,
                                   iters)

    assert newseq._awgspecs == protosequence1._awgspecs
示例#5
0
def test_repeatAndVarySequence_length(protosequence1):
    poss = [1]
    channels = [1]
    names = ['ramp']
    args = ['start']
    iters = [[1, 1.1, 1.2]]

    newseq = repeatAndVarySequence(protosequence1, poss, channels, names, args,
                                   iters)

    expected_l = len(iters[0]) * protosequence1.length_sequenceelements

    assert newseq.length_sequenceelements == expected_l