コード例 #1
0
# to improve import times.

import os, os.path
import platform
from numexpr.expressions import E
from numexpr.necompiler import NumExpr, disassemble, evaluate, re_evaluate

from numexpr.utils import (_init_num_threads, get_vml_version,
                           set_vml_accuracy_mode, set_vml_num_threads,
                           set_num_threads, get_num_threads,
                           detect_number_of_cores, detect_number_of_threads)

# Detect the number of cores
ncores = detect_number_of_cores()
# Initialize the number of threads to be used
nthreads = _init_num_threads()
# The default for VML is 1 thread (see #39)
# set_vml_num_threads(1)

import version
__version__ = version.version


def print_versions():
    """Print the versions of software that numexpr relies on."""
    try:
        import numexpr.tests
        return numexpr.tests.print_versions()
    except ImportError:
        # To maintain Python 2.6 compatibility we have simple error handling
        raise ImportError(
コード例 #2
0
ファイル: __init__.py プロジェクト: pydata/numexpr
# cpuinfo imports were moved into the test submodule function that calls them 
# to improve import times.

import os, os.path
import platform
from numexpr.expressions import E
from numexpr.necompiler import NumExpr, disassemble, evaluate, re_evaluate
from numexpr.interpreter import MAX_THREADS
from numexpr.utils import (_init_num_threads,
    get_vml_version, set_vml_accuracy_mode, set_vml_num_threads,
    set_num_threads, detect_number_of_cores, detect_number_of_threads)

# Detect the number of cores
ncores = detect_number_of_cores()
# Initialize the number of threads to be used
nthreads = _init_num_threads()
# The default for VML is 1 thread (see #39)
set_vml_num_threads(1)

import version
__version__ = version.version

def print_versions():
    """Print the versions of software that numexpr relies on."""
    try:
        import numexpr.tests
        return numexpr.tests.print_versions()
    except ImportError:
        # To maintain Python 2.6 compatibility we have simple error handling
        raise ImportError('`numexpr.tests` could not be imported, likely it was excluded from the distribution.')