numexpr 2.14.0__tar.gz → 2.14.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {numexpr-2.14.0 → numexpr-2.14.2}/ANNOUNCE.rst +22 -12
- {numexpr-2.14.0 → numexpr-2.14.2}/MANIFEST.in +1 -1
- {numexpr-2.14.0 → numexpr-2.14.2}/PKG-INFO +3 -5
- {numexpr-2.14.0 → numexpr-2.14.2}/RELEASE_NOTES.rst +28 -2
- numexpr-2.14.2/VERSION +1 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/bench/large_array_vs_numpy.py +1 -1
- {numexpr-2.14.0 → numexpr-2.14.2}/bench/vml_timing2.py +5 -5
- numexpr-2.14.2/numexpr/__init__.py +66 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/cpuinfo.py +236 -277
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/expressions.py +89 -136
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/interp_body.cpp +4 -4
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/interpreter.cpp +1 -1
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/necompiler.py +172 -181
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/numexpr_object.cpp +1 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/tests/__init__.py +2 -3
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/tests/conftest.py +5 -1
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/tests/test_numexpr.py +56 -3
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/utils.py +40 -76
- numexpr-2.14.2/numexpr/version.py +5 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr.egg-info/PKG-INFO +3 -5
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr.egg-info/SOURCES.txt +0 -3
- numexpr-2.14.2/numexpr.egg-info/requires.txt +1 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/pyproject.toml +4 -26
- numexpr-2.14.2/requirements.txt +1 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/setup.py +0 -2
- numexpr-2.14.0/VERSION +0 -1
- numexpr-2.14.0/numexpr/__init__.py +0 -82
- numexpr-2.14.0/numexpr/interpreter.pyi +0 -52
- numexpr-2.14.0/numexpr/py.typed +0 -0
- numexpr-2.14.0/numexpr/version.py +0 -5
- numexpr-2.14.0/numexpr/version.pyi +0 -6
- numexpr-2.14.0/numexpr.egg-info/requires.txt +0 -1
- numexpr-2.14.0/requirements.txt +0 -1
- {numexpr-2.14.0 → numexpr-2.14.2}/ADDFUNCS.rst +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/AUTHORS.txt +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/LICENSE.txt +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/LICENSES/cpuinfo.txt +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/README.rst +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/bench/boolean_timing.py +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/bench/free_threading.py +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/bench/issue-36.py +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/bench/issue-47.py +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/bench/multidim.py +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/bench/poly.py +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/bench/timing.py +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/bench/unaligned-simple.py +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/bench/varying-expr.py +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/bench/vml_timing.py +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/bench/vml_timing3.py +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/bespoke_functions.hpp +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/complex_functions.hpp +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/functions.hpp +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/interpreter.hpp +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/missing_posix_functions.hpp +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/module.cpp +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/module.hpp +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/msvc_function_stubs.hpp +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/numexpr_config.hpp +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/numexpr_object.hpp +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/opcodes.hpp +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/str-two-way.hpp +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/win32/pthread.c +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/win32/pthread.h +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr/win32/stdint.h +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr.egg-info/dependency_links.txt +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/numexpr.egg-info/top_level.txt +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/setup.cfg +0 -0
- {numexpr-2.14.0 → numexpr-2.14.2}/site.cfg.example +0 -0
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
=========================
|
|
2
|
-
Announcing NumExpr 2.14.
|
|
2
|
+
Announcing NumExpr 2.14.2
|
|
3
3
|
=========================
|
|
4
4
|
|
|
5
5
|
Hi everyone,
|
|
6
6
|
|
|
7
|
-
NumExpr 2.14.
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
NumExpr 2.14.2 is a maintenance release with several bug fixes, a new
|
|
8
|
+
``disable_cache`` option for ``evaluate()``, and updated build/CI support
|
|
9
|
+
(Windows ARM64 wheels, dropped Python 3.10, no more free-threaded 3.13
|
|
10
|
+
wheels).
|
|
10
11
|
|
|
11
12
|
Project documentation is available at:
|
|
12
13
|
|
|
13
14
|
https://numexpr.readthedocs.io/
|
|
14
15
|
|
|
15
|
-
Changes from 2.
|
|
16
|
+
Changes from 2.14.1 to 2.14.2
|
|
16
17
|
-----------------------------
|
|
17
18
|
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
* Added a ``disable_cache`` parameter to ``evaluate()`` to bypass the
|
|
20
|
+
internal expression cache. Thanks to 27rabbitlt.
|
|
21
|
+
* Added Windows ARM64 wheel builds.
|
|
22
|
+
* Dropped support for Python 3.10.
|
|
23
|
+
* No longer build free-threaded Python 3.13 wheels, matching NumPy's own
|
|
24
|
+
support.
|
|
25
|
+
* Avoid keeping arrays passed as ``out=`` alive in the ``re_evaluate`` cache
|
|
26
|
+
(#558).
|
|
27
|
+
* Guarded out-of-range shift counts (shift amount >= bit width) in the
|
|
28
|
+
integer ``<<``/``>>`` opcodes, which was undefined behavior in C and could
|
|
29
|
+
return garbage results. Thanks to uwezkhan (#559).
|
|
30
|
+
* Fixed ``run_interpreter()`` unconditionally returning success even when
|
|
31
|
+
the VM engine failed, so execution errors are now correctly raised
|
|
32
|
+
instead of silently discarded (#557).
|
|
33
|
+
* Fixed a reference leak of ``constsig`` on the allocation-failure path in
|
|
34
|
+
``NumExpr_init()`` (#561).
|
|
25
35
|
|
|
26
36
|
What's Numexpr?
|
|
27
37
|
---------------
|
|
@@ -2,7 +2,7 @@ include MANIFEST.in VERSION
|
|
|
2
2
|
|
|
3
3
|
include *.rst *.txt *.cfg site.cfg.example
|
|
4
4
|
|
|
5
|
-
recursive-include numexpr *.cpp *.hpp *.py
|
|
5
|
+
recursive-include numexpr *.cpp *.hpp *.py
|
|
6
6
|
recursive-include numexpr/win32 *.c *.h
|
|
7
7
|
exclude numexpr/__config__.py RELEASING.txt site.cfg
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: numexpr
|
|
3
|
-
Version: 2.14.
|
|
3
|
+
Version: 2.14.2
|
|
4
4
|
Summary: Fast numerical expression evaluator for NumPy
|
|
5
5
|
Author-email: "David M. Cooke, Francesc Alted, and others" <blosc@blosc.org>
|
|
6
6
|
Maintainer-email: Blosc Development Team <blosc@blosc.org>
|
|
@@ -14,20 +14,18 @@ Classifier: Intended Audience :: Information Technology
|
|
|
14
14
|
Classifier: Intended Audience :: Science/Research
|
|
15
15
|
Classifier: Programming Language :: Python
|
|
16
16
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
|
-
Classifier: Typing :: Typed
|
|
18
17
|
Classifier: Operating System :: Microsoft :: Windows
|
|
19
18
|
Classifier: Operating System :: Unix
|
|
20
19
|
Classifier: Programming Language :: Python :: 3
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
22
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
22
|
Classifier: Programming Language :: Python :: 3.13
|
|
25
23
|
Classifier: Programming Language :: Python :: 3.14
|
|
26
|
-
Requires-Python: >=3.
|
|
24
|
+
Requires-Python: >=3.11
|
|
27
25
|
Description-Content-Type: text/x-rst
|
|
28
26
|
License-File: LICENSE.txt
|
|
29
27
|
License-File: LICENSES/cpuinfo.txt
|
|
30
|
-
Requires-Dist: numpy>=1.
|
|
28
|
+
Requires-Dist: numpy>=1.26.0
|
|
31
29
|
Dynamic: license-file
|
|
32
30
|
|
|
33
31
|
======================================================
|
|
@@ -2,10 +2,37 @@
|
|
|
2
2
|
Release notes for NumExpr 2.14 series
|
|
3
3
|
=====================================
|
|
4
4
|
|
|
5
|
+
Changes from 2.14.1 to 2.14.2
|
|
6
|
+
-----------------------------
|
|
7
|
+
|
|
8
|
+
* Added a ``disable_cache`` parameter to ``evaluate()`` to bypass the
|
|
9
|
+
internal expression cache. Thanks to 27rabbitlt.
|
|
10
|
+
* Added Windows ARM64 wheel builds.
|
|
11
|
+
* Dropped support for Python 3.10.
|
|
12
|
+
* No longer build free-threaded Python 3.13 wheels, matching NumPy's own
|
|
13
|
+
support.
|
|
14
|
+
* Avoid keeping arrays passed as ``out=`` alive in the ``re_evaluate`` cache
|
|
15
|
+
(#558).
|
|
16
|
+
* Guarded out-of-range shift counts (shift amount >= bit width) in the
|
|
17
|
+
integer ``<<``/``>>`` opcodes, which was undefined behavior in C and could
|
|
18
|
+
return garbage results. Thanks to uwezkhan (#559).
|
|
19
|
+
* Fixed ``run_interpreter()`` unconditionally returning success even when
|
|
20
|
+
the VM engine failed, so execution errors are now correctly raised
|
|
21
|
+
instead of silently discarded (#557).
|
|
22
|
+
* Fixed a reference leak of ``constsig`` on the allocation-failure path in
|
|
23
|
+
``NumExpr_init()`` (#561).
|
|
24
|
+
|
|
25
|
+
Changes from 2.14.0 to 2.14.1
|
|
26
|
+
-----------------------------
|
|
27
|
+
|
|
28
|
+
* Rolled back static typing support to ensure compatibiity with NumPy 1.26.
|
|
29
|
+
* Added CI tests for NumPy 1.26
|
|
30
|
+
|
|
31
|
+
|
|
5
32
|
Changes from 2.13.1 to 2.14.0
|
|
6
33
|
-----------------------------
|
|
7
34
|
|
|
8
|
-
* Numerical stability for overflow has been improved for ``tan``
|
|
35
|
+
* Numerical stability for overflow has been improved for ``tan`` / ``tanh``
|
|
9
36
|
to handle possible overflows for complex numbers.
|
|
10
37
|
|
|
11
38
|
* Static typing support has been added, making NumExpr compatible with
|
|
@@ -19,7 +46,6 @@ Changes from 2.13.0 to 2.13.1
|
|
|
19
46
|
* Patch to maximum/minimum functions in order to match NumPy NaN handling
|
|
20
47
|
* Patch to convert '+'->'|' and '*'->'&' for booleans
|
|
21
48
|
|
|
22
|
-
|
|
23
49
|
Changes from 2.12.1 to 2.13.0
|
|
24
50
|
-----------------------------
|
|
25
51
|
|
numexpr-2.14.2/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.14.2
|
|
@@ -78,7 +78,7 @@ def benchmark_numexpr_re_evaluate(expr, a, b, c, results, indices):
|
|
|
78
78
|
for index in indices:
|
|
79
79
|
start = index * chunk_size
|
|
80
80
|
end = (index + 1) * chunk_size
|
|
81
|
-
if index == 0:
|
|
81
|
+
if index == 0 or index == 1:
|
|
82
82
|
# Evaluate the first chunk with evaluate
|
|
83
83
|
time_taken = timeit.timeit(
|
|
84
84
|
lambda: ne.evaluate(
|
|
@@ -13,7 +13,7 @@ import numpy as np
|
|
|
13
13
|
|
|
14
14
|
import numexpr as ne
|
|
15
15
|
|
|
16
|
-
N = int(2**
|
|
16
|
+
N = int(2**28)
|
|
17
17
|
|
|
18
18
|
x = np.linspace(0, 1, N)
|
|
19
19
|
y = np.linspace(0, 1, N)
|
|
@@ -31,17 +31,17 @@ gbs = working_set_GB / (t1-t0)
|
|
|
31
31
|
print("Time for an algebraic expression: %.3f s / %.3f GB/s" % (t1-t0, gbs))
|
|
32
32
|
|
|
33
33
|
t0 = time()
|
|
34
|
-
z = np.sin(x)**2 + np.cos(y)**2
|
|
34
|
+
z = np.sin(x)**3.2 + np.cos(y)**3.2
|
|
35
35
|
t1 = time()
|
|
36
36
|
gbs = working_set_GB / (t1-t0)
|
|
37
37
|
print("Time for a transcendental expression: %.3f s / %.3f GB/s" % (t1-t0, gbs))
|
|
38
38
|
|
|
39
39
|
if ne.use_vml:
|
|
40
40
|
ne.set_vml_num_threads(1)
|
|
41
|
-
ne.set_num_threads(
|
|
41
|
+
ne.set_num_threads(16)
|
|
42
42
|
print("NumExpr version: %s, Using MKL ver. %s, Num threads: %s" % (ne.__version__, ne.get_vml_version(), ne.nthreads))
|
|
43
43
|
else:
|
|
44
|
-
ne.set_num_threads(
|
|
44
|
+
ne.set_num_threads(16)
|
|
45
45
|
print("NumExpr version: %s, Not Using MKL, Num threads: %s" % (ne.__version__, ne.nthreads))
|
|
46
46
|
|
|
47
47
|
t0 = time()
|
|
@@ -51,7 +51,7 @@ gbs = working_set_GB / (t1-t0)
|
|
|
51
51
|
print("Time for an algebraic expression: %.3f s / %.3f GB/s" % (t1-t0, gbs))
|
|
52
52
|
|
|
53
53
|
t0 = time()
|
|
54
|
-
ne.evaluate('sin(x)**2 + cos(y)**2', out = z)
|
|
54
|
+
ne.evaluate('sin(x)**3.2 + cos(y)**3.2', out = z)
|
|
55
55
|
t1 = time()
|
|
56
56
|
gbs = working_set_GB / (t1-t0)
|
|
57
57
|
print("Time for a transcendental expression: %.3f s / %.3f GB/s" % (t1-t0, gbs))
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
###################################################################
|
|
2
|
+
# Numexpr - Fast numerical array expression evaluator for NumPy.
|
|
3
|
+
#
|
|
4
|
+
# License: MIT
|
|
5
|
+
# Author: See AUTHORS.txt
|
|
6
|
+
#
|
|
7
|
+
# See LICENSE.txt and LICENSES/*.txt for details about copyright and
|
|
8
|
+
# rights to use.
|
|
9
|
+
####################################################################
|
|
10
|
+
|
|
11
|
+
"""
|
|
12
|
+
Numexpr is a fast numerical expression evaluator for NumPy. With it,
|
|
13
|
+
expressions that operate on arrays (like "3*a+4*b") are accelerated
|
|
14
|
+
and use less memory than doing the same calculation in Python.
|
|
15
|
+
|
|
16
|
+
See:
|
|
17
|
+
|
|
18
|
+
https://github.com/pydata/numexpr
|
|
19
|
+
|
|
20
|
+
for more info about it.
|
|
21
|
+
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from numexpr.interpreter import __BLOCK_SIZE1__, MAX_THREADS, use_vml
|
|
25
|
+
|
|
26
|
+
is_cpu_amd_intel = False # DEPRECATION WARNING: WILL BE REMOVED IN FUTURE RELEASE
|
|
27
|
+
|
|
28
|
+
# cpuinfo imports were moved into the test submodule function that calls them
|
|
29
|
+
# to improve import times.
|
|
30
|
+
|
|
31
|
+
from numexpr.expressions import E
|
|
32
|
+
from numexpr.necompiler import (NumExpr, disassemble, evaluate, re_evaluate,
|
|
33
|
+
validate)
|
|
34
|
+
from numexpr.utils import (_init_num_threads, detect_number_of_cores,
|
|
35
|
+
detect_number_of_threads, get_num_threads,
|
|
36
|
+
get_vml_version, set_num_threads,
|
|
37
|
+
set_vml_accuracy_mode, set_vml_num_threads)
|
|
38
|
+
|
|
39
|
+
# Detect the number of cores
|
|
40
|
+
ncores = detect_number_of_cores()
|
|
41
|
+
# Initialize the number of threads to be used
|
|
42
|
+
nthreads = _init_num_threads()
|
|
43
|
+
# The default for VML is 1 thread (see #39)
|
|
44
|
+
# set_vml_num_threads(1)
|
|
45
|
+
|
|
46
|
+
from . import version
|
|
47
|
+
|
|
48
|
+
__version__ = version.version
|
|
49
|
+
|
|
50
|
+
def print_versions():
|
|
51
|
+
"""Print the versions of software that numexpr relies on."""
|
|
52
|
+
try:
|
|
53
|
+
import numexpr.tests
|
|
54
|
+
return numexpr.tests.print_versions()
|
|
55
|
+
except ImportError:
|
|
56
|
+
# To maintain Python 2.6 compatibility we have simple error handling
|
|
57
|
+
raise ImportError('`numexpr.tests` could not be imported, likely it was excluded from the distribution.')
|
|
58
|
+
|
|
59
|
+
def test(verbosity=1):
|
|
60
|
+
"""Run all the tests in the test suite."""
|
|
61
|
+
try:
|
|
62
|
+
import numexpr.tests
|
|
63
|
+
return numexpr.tests.test(verbosity=verbosity)
|
|
64
|
+
except ImportError:
|
|
65
|
+
# To maintain Python 2.6 compatibility we have simple error handling
|
|
66
|
+
raise ImportError('`numexpr.tests` could not be imported, likely it was excluded from the distribution.')
|