qcodes/dataset/guids.py
def generate_guid(timeint: Union[int, None]=None,
                  sampleint: Union[int, None]=None) -> str:
    """
    Generate a guid string to go into the GUID column of the runs table.
    The GUID is based on the GUID-components in the qcodesrc file.
    The generated string is of the format
    '12345678-1234-1234-1234-123456789abc', where the first eight hex numbers
    comprise the 4 byte sample code, the next 2 hex numbers comprise the 1 byte
    location, the next 2+4 hex numbers are the 3 byte work station code, and
    the final 4+12 hex number give the 8 byte integer time in ms since epoch
    time

    Args:
        timeint: An integer of miliseconds since unix epoch time
        sampleint: A code for the sample
    """
    cfg = qc.config

    try:
        guid_comp = cfg['GUID_components']
    except KeyError:
        raise RuntimeError('Invalid QCoDeS config file! No GUID_components '
                           'specified. Can not proceed.')

    location = guid_comp['location']
    station = guid_comp['work_station']

    if timeint is None:
        # ms resolution, checked on windows
        timeint = int(np.round(time.time()*1000))
    if sampleint is None:
        sampleint = guid_comp['sample']

    if sampleint == 0:
        sampleint = int('a'*8, base=16)

    loc_str = f'{location:02x}'
    stat_str = f'{station:06x}'
    smpl_str = f'{sampleint:08x}'
    time_str = f'{timeint:016x}'

    guid = (f'{smpl_str}-{loc_str}{stat_str[:2]}-{stat_str[2:]}-'
            f'{time_str[:4]}-{time_str[4:]}')

    return guid

    Generate a guid string to go into the GUID column of the runs table.
    The GUID is based on the GUID-components in the qcodesrc file.
    The generated string is of the format
    '12345678-1234-1234-1234-123456789abc', where the first eight hex numbers
    comprise the 4 byte sample code, the next 2 hex numbers comprise the 1 byte
    location, the next 2+4 hex numbers are the 3 byte work station code, and
    the final 4+12 hex number give the 8 byte integer time in ms since epoch
    time

    Args:
        timeint: An integer of miliseconds since unix epoch time
        sampleint: A code for the sample
    
Generate a guid string to go into the GUID column of the runs table.
The GUID is based on the GUID-components in the qcodesrc file.
The generated string is of the format
'12345678-1234-1234-1234-123456789abc', where the first eight hex numbers
comprise the 4 byte sample code, the next 2 hex numbers comprise the 1 byte
location, the next 2+4 hex numbers are the 3 byte work station code, and
the final 4+12 hex number give the 8 byte integer time in ms since epoch
time
Generate a guid string to go into the GUID column of the runs table . The GUID is based on the GUID - components in the qcodesrc file . The generated string is of the format ' 12345678 - 1234 - 1234 - 1234 - 123456789abc ' where the first eight hex numbers comprise the 4 byte sample code the next 2 hex numbers comprise the 1 byte location the next 2 + 4 hex numbers are the 3 byte work station code and the final 4 + 12 hex number give the 8 byte integer time in ms since epoch time
def generate_guid(timeint: Union[int, None]=None,
                  sampleint: Union[int, None]=None) -> str:
    cfg = qc.config
    try:
        guid_comp = cfg['GUID_components']
    except KeyError:
        raise RuntimeError('Invalid QCoDeS config file! No GUID_components '
                           'specified. Can not proceed.')
    location = guid_comp['location']
    station = guid_comp['work_station']
    if timeint is None:
        timeint = int(np.round(time.time()*1000))
    if sampleint is None:
        sampleint = guid_comp['sample']
    if sampleint == 0:
        sampleint = int('a'*8, base=16)
    loc_str = f'{location:02x}'
    stat_str = f'{station:06x}'
    smpl_str = f'{sampleint:08x}'
    time_str = f'{timeint:016x}'
    guid = (f'{smpl_str}-{loc_str}{stat_str[:2]}-{stat_str[2:]}-'
            f'{time_str[:4]}-{time_str[4:]}')
    return guid
def generate_guid ( timeint : Union [ int , None ] = None , sampleint : Union [ int , None ] = None ) -> str : cfg = qc . config try : guid_comp = cfg [ 'GUID_components' ] except KeyError : raise RuntimeError ( 'Invalid QCoDeS config file! No GUID_components ' 'specified. Can not proceed.' ) location = guid_comp [ 'location' ] station = guid_comp [ 'work_station' ] if timeint is None : timeint = int ( np . round ( time . time ( ) * 1000 ) ) if sampleint is None : sampleint = guid_comp [ 'sample' ] if sampleint == 0 : sampleint = int ( 'a' * 8 , base = 16 ) loc_str = f'{location:02x}' stat_str = f'{station:06x}' smpl_str = f'{sampleint:08x}' time_str = f'{timeint:016x}' guid = ( f'{smpl_str}-{loc_str}{stat_str[:2]}-{stat_str[2:]}-' f'{time_str[:4]}-{time_str[4:]}' ) return guid
Generate a guid string to go into the GUID column of the runs table.
Generate a guid string to go into the GUID column of the runs table .
"""
    Generate a guid string to go into the GUID column of the runs table.
    The GUID is based on the GUID-components in the qcodesrc file.
    The generated string is of the format
    '12345678-1234-1234-1234-123456789abc', where the first eight hex numbers
    comprise the 4 byte sample code, the next 2 hex numbers comprise the 1 byte
    location, the next 2+4 hex numbers are the 3 byte work station code, and
    the final 4+12 hex number give the 8 byte integer time in ms since epoch
    time

    Args:
        timeint: An integer of miliseconds since unix epoch time
        sampleint: A code for the sample
    """ # ms resolution, checked on windows
timeint
Union[int, None]
An integer of miliseconds since unix epoch time
An integer of miliseconds since unix epoch time
sampleint
Union[int, None]
A code for the sample
A code for the sample