UXARRAY / uxarray

Xarray extension for unstructured climate and global weather data analysis and visualization.
https://uxarray.readthedocs.io/
Apache License 2.0
149 stars 31 forks source link

standardize njit and jit-cache usage across the project, cleanup and use JIT related constants in constants.py #969

Open rajeeja opened 2 hours ago

rajeeja commented 2 hours ago

Proposed new feature or change:

codecov doesn't work correctly and track @njit decorated functions, a way to enable disable numba across the project would be useful.

rajeeja commented 2 hours ago

custom decorator


# Custom decorator to enable/disable numba
def optional_numba_jit(nopython=True, parallel=False, cache=False, fastmath=False):
    def decorator(func):
        if USE_NUMBA:
            return numba.jit(nopython=nopython, parallel=parallel, cache=cache, fastmath=fastmath)(func)
        else:
            return func
    return decorator