How to use the anndata.logging function in anndata

To help you get started, we’ve selected a few anndata examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github colomemaria / epiScanpy / episcanpy / logging.py View on Github external
# strip microseconds
            if record.time_passed.microseconds:
                record.time_passed = timedelta(seconds=int(record.time_passed.total_seconds()))
            if '{time_passed}' in record.msg:
                record.msg = record.msg.replace('{time_passed}', str(record.time_passed))
            else:
                self._style._fmt += ' ({time_passed})'
        if record.deep:
            record.msg = f'{record.msg}: {record.deep}'
        result = logging.Formatter.format(self, record)
        self._style._fmt = format_orig
        return result


print_memory_usage = anndata.logging.print_memory_usage
get_memory_usage = anndata.logging.get_memory_usage


_DEPENDENCIES_NUMERICS = [
    'anndata',  # anndata actually shouldn't, but as long as it's in development
    'umap',
    'numpy',
    'scipy',
    'pandas',
    ('sklearn', 'scikit-learn'),
    'statsmodels',
    ('igraph', 'python-igraph'),
    'louvain',
    'leidenalg',
]
github theislab / scanpy / scanpy / logging.py View on Github external
# strip microseconds
            if record.time_passed.microseconds:
                record.time_passed = timedelta(seconds=int(record.time_passed.total_seconds()))
            if '{time_passed}' in record.msg:
                record.msg = record.msg.replace('{time_passed}', str(record.time_passed))
            else:
                self._style._fmt += ' ({time_passed})'
        if record.deep:
            record.msg = f'{record.msg}: {record.deep}'
        result = logging.Formatter.format(self, record)
        self._style._fmt = format_orig
        return result


print_memory_usage = anndata.logging.print_memory_usage
get_memory_usage = anndata.logging.get_memory_usage


_DEPENDENCIES_NUMERICS = [
    'anndata',  # anndata actually shouldn't, but as long as it's in development
    'umap',
    'numpy',
    'scipy',
    'pandas',
    ('sklearn', 'scikit-learn'),
    'statsmodels',
    ('igraph', 'python-igraph'),
    'louvain',
]


_DEPENDENCIES_PLOTTING = ['matplotlib', 'seaborn']