Beispiel #1
0
def logger(request):
    loglevel = request.config.getoption('--loglevel')
    try:
        loglevel = int(loglevel)
    except ValueError:
        loglevel = loglevel.upper()
    return get_logger(level=loglevel)
Beispiel #2
0
import os
import hug
import inspect
import logging as log
import os.path as op

from functools import wraps

from survos2.io import dataset_from_uri
from survos2.config import Config
from survos2.utils import get_logger

logger = get_logger()

CHUNK = Config['computing.chunks']
CHUNK_SIZE = Config['computing.chunk_size']
CHUNK_PAD = Config['computing.chunk_padding']
SCALE = Config['computing.scale']
STRETCH = Config['computing.stretch']


def dataset_repr(ds):
    metadata = dict()
    metadata.update(ds.metadata())
    metadata.pop('__data__', None)
    metadata.setdefault('id', ds.id)
    metadata.setdefault('name', op.basename(ds._path))
    metadata.setdefault('kind', 'unknown')
    return metadata