Skip to content

cellects.utils.decorators

cellects.utils.decorators

njit(*args, **kwargs)

numba.njit decorator that can be disabled. Useful for testing.

Source code in src/cellects/utils/decorators.py
def njit(*args, **kwargs):
    """ numba.njit decorator that can be disabled. Useful for testing.
    """
    if USE_NUMBA:
        return _real_njit(*args, **kwargs)
    # test mode: return identity decorator
    def deco(func):
        return func
    return deco