File: numba_helper.py

package info (click to toggle)
python-pyqtgraph 0.13.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,520 kB
  • sloc: python: 52,773; makefile: 115; ansic: 40; sh: 2
file content (17 lines) | stat: -rw-r--r-- 398 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from warnings import warn

from .. import getConfigOption


def getNumbaFunctions():
    if getConfigOption("useNumba"):
        try:
            import numba  # noqa
        except ImportError:
            warn("numba library could not be loaded, but 'useNumba' is set.")
            return None

        from .. import functions_numba
        return functions_numba
    else:
        return None