spateo.external.lack

Classes

Logger

Aristotle ecosystem-specific logger setting up logging for the package.

LoggerManager

Functions

silence_logger(name)

Given a logger name, silence it completely.

set_logger_level(name, level)

Given a logger name, silence it completely.

format_logging_message(msg, logging_level[, ...])

Module Contents

spateo.external.lack.silence_logger(name)[source]

Given a logger name, silence it completely.

Parameters:
name str

name of the logger

spateo.external.lack.set_logger_level(name, level)[source]

Given a logger name, silence it completely.

Parameters:
name str

name of the logger

spateo.external.lack.format_logging_message(msg, logging_level, indent_level=1, indent_space_num=6)[source]
class spateo.external.lack.Logger(namespace='main', level=None)[source]

Aristotle ecosystem-specific logger setting up logging for the package.

FORMAT = '%(message)s'[source]
namespace[source]
logger[source]
previous_timestamp[source]
time_passed = 0[source]
report_hook_percent_state = None[source]
namespaced(namespace)[source]

Function decorator to set the logging namespace for the duration of the function.

Parameters:
namespace str

the namespace

namespaced_context(namespace)[source]

Context manager to set the logging namespace.

Parameters:
namespace str

the namespace

namespace_message(message)[source]

Add namespace information at the beginning of the logging message.

Parameters:
message str

the logging message

Returns:

namespaced message

Return type:

string

setLevel(*args, **kwargs)[source]
debug(message, indent_level=1, *args, **kwargs)[source]
info(message, indent_level=1, *args, **kwargs)[source]
warning(message, indent_level=1, *args, **kwargs)[source]
exception(message, indent_level=1, *args, **kwargs)[source]
critical(message, indent_level=1, *args, **kwargs)[source]
error(message, indent_level=1, *args, **kwargs)[source]
info_insert_adata(key, adata_attr='obsm', indent_level=1, *args, **kwargs)[source]
info_insert_adata_var(key, indent_level=1, *args, **kwargs)[source]
info_insert_adata_obsm(key, indent_level=1, *args, **kwargs)[source]
info_insert_adata_uns(key, indent_level=1, *args, **kwargs)[source]
log_time()[source]
report_progress(percent=None, count=None, total=None, progress_name='', indent_level=1)[source]
finish_progress(progress_name='', time_unit='s', indent_level=1)[source]
request_report_hook(bn: int, rs: int, ts: int) None[source]

A callback required by the request lib: The reporthook argument should be a callable that accepts a block number, a read size, and the total file size of the URL target. The data argument should be valid URL encoded data.

Parameters:
bs

block number

rs

read size

ts

total size

class spateo.external.lack.LoggerManager(namespace: str = 'lack', temp_timer_logger: str = 'lack-temp-timer-logger')[source]
DEBUG[source]
INFO[source]
CRITICAL[source]
EXCEPTION[source]
static gen_logger(namespace: str)[source]
temp_timer_logger[source]
set_main_logger_namespace(namespace: str)[source]
get_main_logger()[source]
get_temp_timer_logger()[source]
progress_logger(generator, logger=None, progress_name='', indent_level=1)[source]
main_set_level(level)[source]
main_info(message, indent_level=1)[source]
main_debug(message, indent_level=1)[source]
main_warning(message, indent_level=1)[source]
main_exception(message, indent_level=1)[source]
main_critical(message, indent_level=1)[source]
main_tqdm(generator, desc='', indent_level=1, logger=None)[source]

a TQDM style wrapper for logging something like a loop. e.g. for item in main_tqdm(alist, desc=””):

do something

Parameters:
generator [type]

same as what you put in tqdm

desc str, optional

description of your progress

main_log_time()[source]
main_silence()[source]
main_finish_progress(progress_name='')[source]
main_info_insert_adata(key, adata_attr='obsm', indent_level=1, *args, **kwargs)[source]
main_info_insert_adata_var(key, indent_level=1, *args, **kwargs)[source]
main_info_insert_adata_uns(key, indent_level=1, *args, **kwargs)[source]
main_info_insert_adata_obsm(key, indent_level=1, *args, **kwargs)[source]
main_info_insert_adata_obs(key, indent_level=1, *args, **kwargs)[source]
main_info_insert_adata_layer(key, indent_level=1, *args, **kwargs)[source]
main_info_verbose_timeit(msg)[source]