def data(filepath=None, host='localhost', port=_lyse_port, timeout=5):
    if filepath is not None:
        return _get_singleshot(filepath)
    else:
        df = zmq_get(port, host, 'get dataframe', timeout)
        try:
            padding = ('', ) * (df.columns.nlevels - 1)
            try:
                integer_indexing = _labconfig.getboolean(
                    'lyse', 'integer_indexing')
            except (LabConfig.NoOptionError, LabConfig.NoSectionError):
                integer_indexing = False
            if integer_indexing:
                df.set_index(['sequence_index', 'run number', 'run repeat'],
                             inplace=True,
                             drop=False)
            else:
                df.set_index([('sequence', ) + padding,
                              ('run time', ) + padding],
                             inplace=True,
                             drop=False)
                df.index.names = ['sequence', 'run time']
        except KeyError:
            # Empty DataFrame or index column not found, so fall back to RangeIndex instead
            pass
        df.sort_index(inplace=True)
        return df
Example #2
0
def data(filepath=None, host='localhost', timeout=5):
    if filepath is not None:
        return _get_singleshot(filepath)
    else:
        port = 42519
        df = zmq_get(port, host, 'get dataframe', timeout)
        df = df.convert_objects(convert_numeric=True, convert_dates=False)
        try:
            df.set_index(['sequence', 'run time'], inplace=True, drop=False)
        except KeyError:
            # Empty dataframe?
            pass
        df.sort_index(inplace=True)
        return df
Example #3
0
def data(filepath=None, host='localhost', timeout=5):
    if filepath is not None:
        return _get_singleshot(filepath)
    else:
        port = 42519
        df = zmq_get(port, host, 'get dataframe', timeout)
        try:
            padding = ('',)*(df.columns.nlevels - 1)
            df.set_index([('sequence',) + padding,('run time',) + padding], inplace=True, drop=False)
            df.index.names = ['sequence', 'run time']
            # df.set_index(['sequence', 'run time'], inplace=True, drop=False)
        except KeyError:
            # Empty dataframe?
            pass
        df.sort_index(inplace=True)
        return df
def data(filepath=None, host='localhost', timeout=5):
    if filepath is not None:
        return _get_singleshot(filepath)
    else:
        port = 42519
        df = zmq_get(port, host, 'get dataframe', timeout)
        try:
            padding = ('', ) * (df.columns.nlevels - 1)
            df.set_index([('sequence', ) + padding, ('run time', ) + padding],
                         inplace=True,
                         drop=False)
            df.index.names = ['sequence', 'run time']
            # df.set_index(['sequence', 'run time'], inplace=True, drop=False)
        except KeyError:
            # Empty dataframe?
            pass
        df.sort_index(inplace=True)
        return df