Exemplo n.º 1
0
def _get_sqlite_scalar_data(sqlite: SQLiteAnalytics, key: str, select: StepSelect):
    data = sqlite.scalar(key, select.start, select.end)
    if not data:
        return None

    data = sqlite.summarize_scalars(data)

    return data
Exemplo n.º 2
0
def get_sqlite_data(indicator: Indicator):
    run = get_run(indicator.uuid)

    if indicator.uuid not in _SQLITE:
        _SQLITE[indicator.uuid] = SQLiteAnalytics(run.run_info.sqlite_path)

    sqlite: SQLiteAnalytics = _SQLITE[indicator.uuid]

    if indicator.class_ in [IndicatorClass.histogram, IndicatorClass.queue]:
        return _get_sqlite_scalar_data(sqlite, f"{indicator.key}.mean", indicator.select)
    elif indicator.class_ == IndicatorClass.scalar:
        return _get_sqlite_scalar_data(sqlite, indicator.key, indicator.select)
    else:
        return None
Exemplo n.º 3
0
def get_sqlite_data(indicator: Indicator):
    run = get_run(indicator.uuid)

    if indicator.uuid not in _SQLITE:
        _SQLITE[indicator.uuid] = SQLiteAnalytics(run.run_info.sqlite_path)

    sqlite: SQLiteAnalytics = _SQLITE[indicator.uuid]

    if indicator.is_distribution:
        return _get_sqlite_scalar_data(sqlite, f"{indicator.key}.mean",
                                       indicator.select)
    elif indicator.is_scalar:
        return _get_sqlite_scalar_data(sqlite, indicator.key, indicator.select)
    else:
        return None
Exemplo n.º 4
0
def get_artifact_files(indicator: Indicator):
    run = get_run(indicator.uuid)

    if indicator.uuid not in _SQLITE:
        _SQLITE[indicator.uuid] = SQLiteAnalytics(run.run_info.sqlite_path)

    sqlite: SQLiteAnalytics = _SQLITE[indicator.uuid]

    if indicator.class_ != IndicatorClass.tensor:
        return None

    data = sqlite.tensor(indicator.key, indicator.select.start, indicator.select.end)

    if not data:
        return None

    return data