numexpr 2.13.1__tar.gz → 2.14.0__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.13.1 → numexpr-2.14.0}/ANNOUNCE.rst +10 -14
- {numexpr-2.13.1 → numexpr-2.14.0}/MANIFEST.in +1 -1
- {numexpr-2.13.1 → numexpr-2.14.0}/PKG-INFO +2 -1
- {numexpr-2.13.1 → numexpr-2.14.0}/RELEASE_NOTES.rst +13 -1
- numexpr-2.14.0/VERSION +1 -0
- numexpr-2.14.0/numexpr/__init__.py +82 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/complex_functions.hpp +33 -30
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/cpuinfo.py +277 -236
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/expressions.py +136 -89
- numexpr-2.14.0/numexpr/interpreter.pyi +52 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/necompiler.py +179 -118
- numexpr-2.14.0/numexpr/py.typed +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/tests/__init__.py +3 -2
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/tests/conftest.py +1 -1
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/tests/test_numexpr.py +8 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/utils.py +76 -40
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/version.py +2 -2
- numexpr-2.14.0/numexpr/version.pyi +6 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr.egg-info/PKG-INFO +2 -1
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr.egg-info/SOURCES.txt +3 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/pyproject.toml +21 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/setup.py +2 -0
- numexpr-2.13.1/VERSION +0 -1
- numexpr-2.13.1/numexpr/__init__.py +0 -66
- {numexpr-2.13.1 → numexpr-2.14.0}/ADDFUNCS.rst +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/AUTHORS.txt +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/LICENSE.txt +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/LICENSES/cpuinfo.txt +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/README.rst +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/bench/boolean_timing.py +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/bench/free_threading.py +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/bench/issue-36.py +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/bench/issue-47.py +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/bench/large_array_vs_numpy.py +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/bench/multidim.py +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/bench/poly.py +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/bench/timing.py +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/bench/unaligned-simple.py +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/bench/varying-expr.py +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/bench/vml_timing.py +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/bench/vml_timing2.py +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/bench/vml_timing3.py +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/bespoke_functions.hpp +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/functions.hpp +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/interp_body.cpp +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/interpreter.cpp +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/interpreter.hpp +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/missing_posix_functions.hpp +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/module.cpp +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/module.hpp +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/msvc_function_stubs.hpp +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/numexpr_config.hpp +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/numexpr_object.cpp +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/numexpr_object.hpp +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/opcodes.hpp +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/str-two-way.hpp +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/win32/pthread.c +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/win32/pthread.h +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr/win32/stdint.h +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr.egg-info/dependency_links.txt +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr.egg-info/requires.txt +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/numexpr.egg-info/top_level.txt +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/requirements.txt +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/setup.cfg +0 -0
- {numexpr-2.13.1 → numexpr-2.14.0}/site.cfg.example +0 -0
|
@@ -1,31 +1,27 @@
|
|
|
1
1
|
=========================
|
|
2
|
-
Announcing NumExpr 2.
|
|
2
|
+
Announcing NumExpr 2.14.
|
|
3
3
|
=========================
|
|
4
4
|
|
|
5
5
|
Hi everyone,
|
|
6
6
|
|
|
7
|
-
NumExpr 2.
|
|
8
|
-
|
|
9
|
-
Thanks to Luke Shaw for these contributions.
|
|
7
|
+
NumExpr 2.14.0 introduces a couple of patches for tan/tanh and
|
|
8
|
+
adds static typing support.
|
|
9
|
+
Thanks to Luke Shaw and Joren Hammudoglu (@jorenham) for these contributions.
|
|
10
10
|
|
|
11
11
|
Project documentation is available at:
|
|
12
12
|
|
|
13
13
|
https://numexpr.readthedocs.io/
|
|
14
14
|
|
|
15
|
-
Changes from 2.
|
|
15
|
+
Changes from 2.13.1 to 2.14.0
|
|
16
16
|
-----------------------------
|
|
17
17
|
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
* New binary arithmetic operator for floor division: `//`
|
|
21
|
-
* New functions: `signbit`, `hypot`, `copysign`, `nextafter`, `maximum`,
|
|
22
|
-
`minimum`, `log2`, `trunc`, `round` and `sign`.
|
|
23
|
-
* Also enables integer outputs for integer inputs for
|
|
24
|
-
`abs`, `fmod`, `copy`, `ones_like`, `sign` and `round`.
|
|
18
|
+
* Numerical stability for overflow has been improved for ``tan`` and ``tanh``
|
|
19
|
+
to handle possible overflows for complex numbers.
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
* Static typing support has been added, making NumExpr compatible with
|
|
22
|
+
static type checkers like `mypy` and `pyright`.
|
|
23
|
+
Thanks to Joren Hammudoglu (@jorenham) for the work.
|
|
27
24
|
|
|
28
|
-
* New wheels for Python 3.14 and 3.14t are provided.
|
|
29
25
|
|
|
30
26
|
What's Numexpr?
|
|
31
27
|
---------------
|
|
@@ -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 *.pyi py.typed
|
|
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.
|
|
3
|
+
Version: 2.14.0
|
|
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,6 +14,7 @@ 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
|
|
17
18
|
Classifier: Operating System :: Microsoft :: Windows
|
|
18
19
|
Classifier: Operating System :: Unix
|
|
19
20
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
=====================================
|
|
2
|
-
Release notes for NumExpr 2.
|
|
2
|
+
Release notes for NumExpr 2.14 series
|
|
3
3
|
=====================================
|
|
4
4
|
|
|
5
|
+
Changes from 2.13.1 to 2.14.0
|
|
6
|
+
-----------------------------
|
|
7
|
+
|
|
8
|
+
* Numerical stability for overflow has been improved for ``tan`` and ``tanh``
|
|
9
|
+
to handle possible overflows for complex numbers.
|
|
10
|
+
|
|
11
|
+
* Static typing support has been added, making NumExpr compatible with
|
|
12
|
+
static type checkers like `mypy` and `pyright`.
|
|
13
|
+
Thanks to Joren Hammudoglu (@jorenham) for the work.
|
|
14
|
+
|
|
15
|
+
|
|
5
16
|
Changes from 2.13.0 to 2.13.1
|
|
6
17
|
-----------------------------
|
|
7
18
|
|
|
8
19
|
* Patch to maximum/minimum functions in order to match NumPy NaN handling
|
|
9
20
|
* Patch to convert '+'->'|' and '*'->'&' for booleans
|
|
10
21
|
|
|
22
|
+
|
|
11
23
|
Changes from 2.12.1 to 2.13.0
|
|
12
24
|
-----------------------------
|
|
13
25
|
|
numexpr-2.14.0/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.14.0
|
|
@@ -0,0 +1,82 @@
|
|
|
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 typing import TYPE_CHECKING, Final
|
|
25
|
+
|
|
26
|
+
if TYPE_CHECKING:
|
|
27
|
+
import unittest
|
|
28
|
+
|
|
29
|
+
# the `import _ as _` are needed for mypy to understand these are re-exports
|
|
30
|
+
|
|
31
|
+
from numexpr.interpreter import __BLOCK_SIZE1__ as __BLOCK_SIZE1__
|
|
32
|
+
from numexpr.interpreter import MAX_THREADS as MAX_THREADS
|
|
33
|
+
from numexpr.interpreter import use_vml as use_vml
|
|
34
|
+
|
|
35
|
+
is_cpu_amd_intel: Final = False # DEPRECATION WARNING: WILL BE REMOVED IN FUTURE RELEASE
|
|
36
|
+
|
|
37
|
+
# cpuinfo imports were moved into the test submodule function that calls them
|
|
38
|
+
# to improve import times.
|
|
39
|
+
|
|
40
|
+
from numexpr.expressions import E as E
|
|
41
|
+
from numexpr.necompiler import NumExpr as NumExpr
|
|
42
|
+
from numexpr.necompiler import disassemble as disassemble
|
|
43
|
+
from numexpr.necompiler import evaluate as evaluate
|
|
44
|
+
from numexpr.necompiler import re_evaluate as re_evaluate
|
|
45
|
+
from numexpr.necompiler import validate as validate
|
|
46
|
+
from numexpr.utils import _init_num_threads
|
|
47
|
+
from numexpr.utils import detect_number_of_cores as detect_number_of_cores
|
|
48
|
+
from numexpr.utils import detect_number_of_threads as detect_number_of_threads
|
|
49
|
+
from numexpr.utils import get_num_threads as get_num_threads
|
|
50
|
+
from numexpr.utils import get_vml_version as get_vml_version
|
|
51
|
+
from numexpr.utils import set_num_threads as set_num_threads
|
|
52
|
+
from numexpr.utils import set_vml_accuracy_mode as set_vml_accuracy_mode
|
|
53
|
+
from numexpr.utils import set_vml_num_threads as set_vml_num_threads
|
|
54
|
+
|
|
55
|
+
# Detect the number of cores
|
|
56
|
+
ncores: Final = detect_number_of_cores()
|
|
57
|
+
# Initialize the number of threads to be used
|
|
58
|
+
nthreads: Final = _init_num_threads()
|
|
59
|
+
# The default for VML is 1 thread (see #39)
|
|
60
|
+
# set_vml_num_threads(1)
|
|
61
|
+
|
|
62
|
+
from . import version as version
|
|
63
|
+
|
|
64
|
+
__version__: Final = version.version
|
|
65
|
+
|
|
66
|
+
def print_versions() -> None:
|
|
67
|
+
"""Print the versions of software that numexpr relies on."""
|
|
68
|
+
try:
|
|
69
|
+
import numexpr.tests
|
|
70
|
+
return numexpr.tests.print_versions() # type: ignore[no-untyped-call]
|
|
71
|
+
except ImportError:
|
|
72
|
+
# To maintain Python 2.6 compatibility we have simple error handling
|
|
73
|
+
raise ImportError('`numexpr.tests` could not be imported, likely it was excluded from the distribution.')
|
|
74
|
+
|
|
75
|
+
def test(verbosity: int = 1) -> "unittest.result.TestResult":
|
|
76
|
+
"""Run all the tests in the test suite."""
|
|
77
|
+
try:
|
|
78
|
+
import numexpr.tests
|
|
79
|
+
return numexpr.tests.test(verbosity=verbosity) # type: ignore[no-untyped-call]
|
|
80
|
+
except ImportError:
|
|
81
|
+
# To maintain Python 2.6 compatibility we have simple error handling
|
|
82
|
+
raise ImportError('`numexpr.tests` could not be imported, likely it was excluded from the distribution.')
|
|
@@ -390,42 +390,45 @@ nc_sinh(std::complex<double> *x, std::complex<double> *r)
|
|
|
390
390
|
static void
|
|
391
391
|
nc_tan(std::complex<double> *x, std::complex<double> *r)
|
|
392
392
|
{
|
|
393
|
-
double
|
|
394
|
-
double
|
|
395
|
-
double
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
393
|
+
double xr = x->real();
|
|
394
|
+
double xi = x->imag();
|
|
395
|
+
double imag_part;
|
|
396
|
+
|
|
397
|
+
double denom = cos(2*xr) + cosh(2*xi);
|
|
398
|
+
// handle overflows
|
|
399
|
+
if (xi > 20) {
|
|
400
|
+
imag_part = 1.0 / (1.0 + exp(-4*xi));
|
|
401
|
+
} else if (xi < -20) {
|
|
402
|
+
imag_part = -1.0 / (1.0 + exp(4*xi));
|
|
403
|
+
} else {
|
|
404
|
+
imag_part = sinh(2*xi) / denom;
|
|
405
|
+
}
|
|
406
|
+
double real_part = sin(2*xr) / denom;
|
|
407
|
+
|
|
408
|
+
r->real(real_part);
|
|
409
|
+
r->imag(imag_part);
|
|
408
410
|
return;
|
|
409
411
|
}
|
|
410
412
|
|
|
411
413
|
static void
|
|
412
414
|
nc_tanh(std::complex<double> *x, std::complex<double> *r)
|
|
413
415
|
{
|
|
414
|
-
double
|
|
415
|
-
double
|
|
416
|
-
double
|
|
417
|
-
double
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
r->
|
|
416
|
+
double xr = x->real();
|
|
417
|
+
double xi = x->imag();
|
|
418
|
+
double real_part;
|
|
419
|
+
double denom = cosh(2*xr) + cos(2*xi);
|
|
420
|
+
// handle overflows
|
|
421
|
+
if (xr > 20) {
|
|
422
|
+
real_part = 1.0 / (1.0 + exp(-4*xr));
|
|
423
|
+
} else if (xr < -20) {
|
|
424
|
+
real_part = -1.0 / (1.0 + exp(4*xr));
|
|
425
|
+
} else {
|
|
426
|
+
real_part = sinh(2*xr) / denom;
|
|
427
|
+
}
|
|
428
|
+
double imag_part = sin(2*xi) / denom;
|
|
429
|
+
|
|
430
|
+
r->real(real_part);
|
|
431
|
+
r->imag(imag_part);
|
|
429
432
|
return;
|
|
430
433
|
}
|
|
431
434
|
|