qcodes/tests/drivers/test_tektronix_AWG70000A.py
def _make_forged_sequence():
    """
    Return an example forged sequence containing a
    subsequence
    """

    N = 5
    num_chans = 3
    types = ['element']*(N-1) + ['subsequence']

    def random_element(num_chans):
        """
        Return an element with random values

        2400 points long, the minimum allowed by the instrument
        """
        data = {n: {} for n in range(1, 1 + num_chans)}
        for key in data.keys():
            data[key] = {'wfm': np.random.randn(2400),
                         'm1': np.random.randint(0, 2, 2400),
                         'm2': np.random.randint(0, 2, 2400)}

        return data

    seq = {i: {} for i in range(1, 1 + N)}
    for pos1, typ in zip(seq.keys(), types):
        seq[pos1] = {'type': typ,
                     'content': {},
                     'sequencing': {}}

    for pos1 in range(1, N):
        seq[pos1]['content'] = {1: {'data': random_element(num_chans)}}

    # and finally add the subsequence
    seq[N]['content'] = {1: {'data': random_element(num_chans),
                             'sequencing': {'nreps': 2}},
                         2: {'data': random_element(num_chans),
                             'sequencing': {'nreps': 2}}}

    return seq

    Return an example forged sequence containing a
    subsequence
    
Return an example forged sequence containing a
subsequence
Return an example forged sequence containing a subsequence
def _make_forged_sequence():
    N = 5
    num_chans = 3
    types = ['element']*(N-1) + ['subsequence']
    def random_element(num_chans):
        data = {n: {} for n in range(1, 1 + num_chans)}
        for key in data.keys():
            data[key] = {'wfm': np.random.randn(2400),
                         'm1': np.random.randint(0, 2, 2400),
                         'm2': np.random.randint(0, 2, 2400)}
        return data
    seq = {i: {} for i in range(1, 1 + N)}
    for pos1, typ in zip(seq.keys(), types):
        seq[pos1] = {'type': typ,
                     'content': {},
                     'sequencing': {}}
    for pos1 in range(1, N):
        seq[pos1]['content'] = {1: {'data': random_element(num_chans)}}
    seq[N]['content'] = {1: {'data': random_element(num_chans),
                             'sequencing': {'nreps': 2}},
                         2: {'data': random_element(num_chans),
                             'sequencing': {'nreps': 2}}}
    return seq
def _make_forged_sequence ( ) : N = 5 num_chans = 3 types = [ 'element' ] * ( N - 1 ) + [ 'subsequence' ] def random_element ( num_chans ) : """
        Return an element with random values

        2400 points long, the minimum allowed by the instrument
        """ data = { n : { } for n in range ( 1 , 1 + num_chans ) } for key in data . keys ( ) : data [ key ] = { 'wfm' : np . random . randn ( 2400 ) , 'm1' : np . random . randint ( 0 , 2 , 2400 ) , 'm2' : np . random . randint ( 0 , 2 , 2400 ) } return data seq = { i : { } for i in range ( 1 , 1 + N ) } for pos1 , typ in zip ( seq . keys ( ) , types ) : seq [ pos1 ] = { 'type' : typ , 'content' : { } , 'sequencing' : { } } for pos1 in range ( 1 , N ) : seq [ pos1 ] [ 'content' ] = { 1 : { 'data' : random_element ( num_chans ) } } seq [ N ] [ 'content' ] = { 1 : { 'data' : random_element ( num_chans ) , 'sequencing' : { 'nreps' : 2 } } , 2 : { 'data' : random_element ( num_chans ) , 'sequencing' : { 'nreps' : 2 } } } return seq
Return an example forged sequence containing a
subsequence
Return an example forged sequence containing a subsequence
"""
    Return an example forged sequence containing a
    subsequence
    """ """
        Return an element with random values

        2400 points long, the minimum allowed by the instrument
        """ # and finally add the subsequence