numexpr 2.13.0__tar.gz → 2.13.1__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.0 → numexpr-2.13.1}/ANNOUNCE.rst +14 -12
- {numexpr-2.13.0 → numexpr-2.13.1}/PKG-INFO +1 -1
- {numexpr-2.13.0 → numexpr-2.13.1}/RELEASE_NOTES.rst +11 -7
- numexpr-2.13.1/VERSION +1 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/bespoke_functions.hpp +45 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/expressions.py +3 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/functions.hpp +4 -4
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/msvc_function_stubs.hpp +53 -43
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/numexpr_config.hpp +7 -3
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/tests/test_numexpr.py +15 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/version.py +2 -2
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr.egg-info/PKG-INFO +1 -1
- numexpr-2.13.0/VERSION +0 -1
- {numexpr-2.13.0 → numexpr-2.13.1}/ADDFUNCS.rst +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/AUTHORS.txt +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/LICENSE.txt +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/LICENSES/cpuinfo.txt +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/MANIFEST.in +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/README.rst +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/bench/boolean_timing.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/bench/free_threading.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/bench/issue-36.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/bench/issue-47.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/bench/large_array_vs_numpy.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/bench/multidim.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/bench/poly.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/bench/timing.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/bench/unaligned-simple.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/bench/varying-expr.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/bench/vml_timing.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/bench/vml_timing2.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/bench/vml_timing3.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/__init__.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/complex_functions.hpp +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/cpuinfo.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/interp_body.cpp +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/interpreter.cpp +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/interpreter.hpp +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/missing_posix_functions.hpp +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/module.cpp +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/module.hpp +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/necompiler.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/numexpr_object.cpp +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/numexpr_object.hpp +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/opcodes.hpp +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/str-two-way.hpp +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/tests/__init__.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/tests/conftest.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/utils.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/win32/pthread.c +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/win32/pthread.h +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr/win32/stdint.h +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr.egg-info/SOURCES.txt +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr.egg-info/dependency_links.txt +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr.egg-info/requires.txt +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/numexpr.egg-info/top_level.txt +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/pyproject.toml +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/requirements.txt +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/setup.cfg +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/setup.py +0 -0
- {numexpr-2.13.0 → numexpr-2.13.1}/site.cfg.example +0 -0
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
=========================
|
|
2
|
-
Announcing NumExpr 2.13.
|
|
2
|
+
Announcing NumExpr 2.13.
|
|
3
3
|
=========================
|
|
4
4
|
|
|
5
5
|
Hi everyone,
|
|
6
6
|
|
|
7
|
-
NumExpr 2.13.
|
|
8
|
-
|
|
9
|
-
many new functions (like hypot, log2, maximum, minimum, nextafter...).
|
|
7
|
+
NumExpr 2.13.1 introduces a couple of patches for maximum/minimum and
|
|
8
|
+
multiplication/addition for booleans to match NumPy behaviour.
|
|
10
9
|
Thanks to Luke Shaw for these contributions.
|
|
11
10
|
|
|
12
11
|
Project documentation is available at:
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
https://numexpr.readthedocs.io/
|
|
15
14
|
|
|
16
|
-
Changes from 2.12.
|
|
15
|
+
Changes from 2.12.1 to 2.13.0
|
|
17
16
|
-----------------------------
|
|
18
17
|
|
|
19
|
-
*
|
|
20
|
-
|
|
18
|
+
* New functionality has been added:
|
|
19
|
+
* Bitwise operators (and, or, not, xor): `&, |, ~, ^`
|
|
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`.
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
for adding new functions to the virtual machine. Thanks to Luke Shaw.
|
|
26
|
+
Thanks to Luke Shaw for the contributions.
|
|
24
27
|
|
|
25
|
-
*
|
|
26
|
-
Christoph Gohlke for reporting the issue.
|
|
28
|
+
* New wheels for Python 3.14 and 3.14t are provided.
|
|
27
29
|
|
|
28
30
|
What's Numexpr?
|
|
29
31
|
---------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: numexpr
|
|
3
|
-
Version: 2.13.
|
|
3
|
+
Version: 2.13.1
|
|
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>
|
|
@@ -2,22 +2,26 @@
|
|
|
2
2
|
Release notes for NumExpr 2.13 series
|
|
3
3
|
=====================================
|
|
4
4
|
|
|
5
|
+
Changes from 2.13.0 to 2.13.1
|
|
6
|
+
-----------------------------
|
|
7
|
+
|
|
8
|
+
* Patch to maximum/minimum functions in order to match NumPy NaN handling
|
|
9
|
+
* Patch to convert '+'->'|' and '*'->'&' for booleans
|
|
5
10
|
|
|
6
11
|
Changes from 2.12.1 to 2.13.0
|
|
7
12
|
-----------------------------
|
|
8
13
|
|
|
9
14
|
* New functionality has been added:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* Also enables integer outputs for integer inputs for
|
|
15
|
-
`abs`, `fmod`, `copy`, `ones_like`, `sign` and `round`.
|
|
15
|
+
* Bitwise operators (and, or, not, xor): `&, |, ~, ^`
|
|
16
|
+
* New binary arithmetic operator for floor division: `//`
|
|
17
|
+
* New functions: `signbit`, `hypot`, `copysign`, `nextafter`, `maximum`, `minimum`, `log2`, `trunc`, `round` and `sign`.
|
|
18
|
+
* Also enables integer outputs for integer inputs for `abs`, `copy`, `ones_like`, `sign` and `round`.
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
Thanks to Luke Shaw for the contributions.
|
|
18
21
|
|
|
19
22
|
* New wheels for Python 3.14 and 3.14t are provided.
|
|
20
23
|
|
|
24
|
+
|
|
21
25
|
Changes from 2.12.0 to 2.12.1
|
|
22
26
|
-----------------------------
|
|
23
27
|
|
numexpr-2.13.1/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.13.1
|
|
@@ -35,6 +35,51 @@ inline long fabsl(long x) {return x<0 ? -x: x;}
|
|
|
35
35
|
// inline long fmodl(long x, long y) {return (long)fmodf((long)x, (long)y);}
|
|
36
36
|
|
|
37
37
|
#ifdef USE_VML
|
|
38
|
+
// To match Numpy behaviour for NaNs
|
|
39
|
+
static void vsFmax_(MKL_INT n, const float* x1, const float* x2, float* dest)
|
|
40
|
+
{
|
|
41
|
+
vsFmax(n, x1, x2, dest);
|
|
42
|
+
MKL_INT j;
|
|
43
|
+
for (j=0; j<n; j++) {
|
|
44
|
+
if (isnanf_(x1[j]) | isnanf_(x2[j])){
|
|
45
|
+
dest[j] = NAN;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
static void vsFmin_(MKL_INT n, const float* x1, const float* x2, float* dest)
|
|
51
|
+
{
|
|
52
|
+
vsFmin(n, x1, x2, dest);
|
|
53
|
+
MKL_INT j;
|
|
54
|
+
for (j=0; j<n; j++) {
|
|
55
|
+
if (isnanf_(x1[j]) | isnanf_(x2[j])){
|
|
56
|
+
dest[j] = NAN;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
// To match Numpy behaviour for NaNs
|
|
61
|
+
static void vdFmax_(MKL_INT n, const double* x1, const double* x2, double* dest)
|
|
62
|
+
{
|
|
63
|
+
vdFmax(n, x1, x2, dest);
|
|
64
|
+
MKL_INT j;
|
|
65
|
+
for (j=0; j<n; j++) {
|
|
66
|
+
if (isnand(x1[j]) | isnand(x2[j])){
|
|
67
|
+
dest[j] = NAN;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
static void vdFmin_(MKL_INT n, const double* x1, const double* x2, double* dest)
|
|
73
|
+
{
|
|
74
|
+
vdFmin(n, x1, x2, dest);
|
|
75
|
+
MKL_INT j;
|
|
76
|
+
for (j=0; j<n; j++) {
|
|
77
|
+
if (isnand(x1[j]) | isnand(x2[j])){
|
|
78
|
+
dest[j] = NAN;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
|
|
38
83
|
static void viRint(MKL_INT n, const int* x, int* dest)
|
|
39
84
|
{
|
|
40
85
|
memcpy(dest, x, n * sizeof(int)); // just copy x1 which is already int
|
|
@@ -531,6 +531,9 @@ class OpNode(ExpressionNode):
|
|
|
531
531
|
def __init__(self, opcode=None, args=None, kind=None):
|
|
532
532
|
if (kind is None) and (args is not None):
|
|
533
533
|
kind = commonKind(args)
|
|
534
|
+
if kind=='bool': # handle bool*bool and bool+bool cases
|
|
535
|
+
opcode = 'and' if opcode=='mul' else opcode
|
|
536
|
+
opcode = 'or' if opcode=='add' else opcode
|
|
534
537
|
ExpressionNode.__init__(self, value=opcode, kind=kind, children=args)
|
|
535
538
|
|
|
536
539
|
|
|
@@ -56,8 +56,8 @@ FUNC_FFF(FUNC_ARCTAN2_FFF, "arctan2_fff", atan2f, atan2f2, vsAtan2)
|
|
|
56
56
|
FUNC_FFF(FUNC_HYPOT_FFF, "hypot_fff", hypotf, hypotf2, vsHypot)
|
|
57
57
|
FUNC_FFF(FUNC_NEXTAFTER_FFF, "nextafter_fff", nextafterf, nextafterf2, vsNextAfter)
|
|
58
58
|
FUNC_FFF(FUNC_COPYSIGN_FFF, "copysign_fff", copysignf, copysignf2, vsCopySign)
|
|
59
|
-
FUNC_FFF(FUNC_MAXIMUM_FFF, "maximum_fff",
|
|
60
|
-
FUNC_FFF(FUNC_MINIMUM_FFF, "minimum_fff",
|
|
59
|
+
FUNC_FFF(FUNC_MAXIMUM_FFF, "maximum_fff", fmaxf_, fmaxf2, vsFmax_)
|
|
60
|
+
FUNC_FFF(FUNC_MINIMUM_FFF, "minimum_fff", fminf_, fminf2, vsFmin_)
|
|
61
61
|
FUNC_FFF(FUNC_FFF_LAST, NULL, NULL, NULL, NULL)
|
|
62
62
|
#ifdef ELIDE_FUNC_FFF
|
|
63
63
|
#undef ELIDE_FUNC_FFF
|
|
@@ -140,8 +140,8 @@ FUNC_DDD(FUNC_ARCTAN2_DDD, "arctan2_ddd", atan2, vdAtan2)
|
|
|
140
140
|
FUNC_DDD(FUNC_HYPOT_DDD, "hypot_ddd", hypot, vdHypot)
|
|
141
141
|
FUNC_DDD(FUNC_NEXTAFTER_DDD, "nextafter_ddd", nextafter, vdNextAfter)
|
|
142
142
|
FUNC_DDD(FUNC_COPYSIGN_DDD, "copysign_ddd", copysign, vdCopySign)
|
|
143
|
-
FUNC_DDD(FUNC_MAXIMUM_DDD, "maximum_ddd", fmaxd,
|
|
144
|
-
FUNC_DDD(FUNC_MINIMUM_DDD, "minimum_ddd", fmind,
|
|
143
|
+
FUNC_DDD(FUNC_MAXIMUM_DDD, "maximum_ddd", fmaxd, vdFmax_)
|
|
144
|
+
FUNC_DDD(FUNC_MINIMUM_DDD, "minimum_ddd", fmind, vdFmin_)
|
|
145
145
|
FUNC_DDD(FUNC_DDD_LAST, NULL, NULL, NULL)
|
|
146
146
|
#ifdef ELIDE_FUNC_DDD
|
|
147
147
|
#undef ELIDE_FUNC_DDD
|
|
@@ -16,47 +16,6 @@
|
|
|
16
16
|
definitions in <math.h> are actually #define'd and are not usable
|
|
17
17
|
as function pointers :-/ */
|
|
18
18
|
|
|
19
|
-
#if _MSC_VER < 1400 // 1310 == MSVC 7.1
|
|
20
|
-
/* Apparently, single precision functions are not included in MSVC 7.1 */
|
|
21
|
-
|
|
22
|
-
#define sqrtf(x) ((float)sqrt((double)(x)))
|
|
23
|
-
#define sinf(x) ((float)sin((double)(x)))
|
|
24
|
-
#define cosf(x) ((float)cos((double)(x)))
|
|
25
|
-
#define tanf(x) ((float)tan((double)(x)))
|
|
26
|
-
#define asinf(x) ((float)asin((double)(x)))
|
|
27
|
-
#define acosf(x) ((float)acos((double)(x)))
|
|
28
|
-
#define atanf(x) ((float)atan((double)(x)))
|
|
29
|
-
#define sinhf(x) ((float)sinh((double)(x)))
|
|
30
|
-
#define coshf(x) ((float)cosh((double)(x)))
|
|
31
|
-
#define tanhf(x) ((float)tanh((double)(x)))
|
|
32
|
-
#define asinhf(x) ((float)asinh((double)(x)))
|
|
33
|
-
#define acoshf(x) ((float)acosh((double)(x)))
|
|
34
|
-
#define atanhf(x) ((float)atanh((double)(x)))
|
|
35
|
-
#define logf(x) ((float)log((double)(x)))
|
|
36
|
-
#define log1pf(x) ((float)log1p((double)(x)))
|
|
37
|
-
#define log10f(x) ((float)log10((double)(x)))
|
|
38
|
-
#define log2f(x) ((float)log2((double)(x)))
|
|
39
|
-
#define expf(x) ((float)exp((double)(x)))
|
|
40
|
-
#define expm1f(x) ((float)expm1((double)(x)))
|
|
41
|
-
#define fabsf(x) ((float)fabs((double)(x)))
|
|
42
|
-
#define fmodf(x, y) ((float)fmod((double)(x), (double)(y)))
|
|
43
|
-
#define atan2f(x, y) ((float)atan2((double)(x), (double)(y)))
|
|
44
|
-
#define hypotf(x, y) ((float)hypot((double)(x), (double)(y)))
|
|
45
|
-
#define copysignf(x, y) ((float)copysign((double)(x), (double)(y)))
|
|
46
|
-
#define nextafterf(x, y) ((float)nextafter((double)(x), (double)(y)))
|
|
47
|
-
#define fmaxf(x, y) ((float)fmaxd((double)(x), (double)(y)))
|
|
48
|
-
#define fminf(x, y) ((float)fmind((double)(x), (double)(y)))
|
|
49
|
-
#define ceilf(x) ((float)ceil((double)(x)))
|
|
50
|
-
#define hypotf(x) ((float)hypot((double)(x)))
|
|
51
|
-
#define rintf(x) ((float)rint((double)(x)))
|
|
52
|
-
#define truncf(x) ((float)trunc((double)(x)))
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
/* The next are directly called from interp_body.cpp */
|
|
56
|
-
#define powf(x, y) ((float)pow((double)(x), (double)(y)))
|
|
57
|
-
#define floorf(x) ((float)floor((double)(x)))
|
|
58
|
-
#endif // _MSC_VER < 1400
|
|
59
|
-
|
|
60
19
|
/* Due to casting problems (normally return ints not bools, easiest to define
|
|
61
20
|
non-overloaded wrappers for these functions) */
|
|
62
21
|
// MSVC version: use global ::isfinite / ::isnan
|
|
@@ -67,6 +26,57 @@ inline bool isnand(double x) { return !!::_isnan(x); }
|
|
|
67
26
|
inline bool isinfd(double x) { return !!::isinf(x); }
|
|
68
27
|
inline bool isinff_(float x) { return !!::isinf(x); }
|
|
69
28
|
|
|
29
|
+
// To handle overloading of fmax/fmin in cmath and match NumPy behaviour for NaNs
|
|
30
|
+
inline double fmaxd(double x, double y) { return (isnand(x) | isnand(y))? NAN : fmax(x, y); }
|
|
31
|
+
inline double fmind(double x, double y) { return (isnand(x) | isnand(y))? NAN : fmin(x, y); }
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
#if _MSC_VER < 1400 // 1310 == MSVC 7.1
|
|
35
|
+
/* Apparently, single precision functions are not included in MSVC 7.1 */
|
|
36
|
+
|
|
37
|
+
#define sqrtf(x) ((float)sqrt((double)(x)))
|
|
38
|
+
#define sinf(x) ((float)sin((double)(x)))
|
|
39
|
+
#define cosf(x) ((float)cos((double)(x)))
|
|
40
|
+
#define tanf(x) ((float)tan((double)(x)))
|
|
41
|
+
#define asinf(x) ((float)asin((double)(x)))
|
|
42
|
+
#define acosf(x) ((float)acos((double)(x)))
|
|
43
|
+
#define atanf(x) ((float)atan((double)(x)))
|
|
44
|
+
#define sinhf(x) ((float)sinh((double)(x)))
|
|
45
|
+
#define coshf(x) ((float)cosh((double)(x)))
|
|
46
|
+
#define tanhf(x) ((float)tanh((double)(x)))
|
|
47
|
+
#define asinhf(x) ((float)asinh((double)(x)))
|
|
48
|
+
#define acoshf(x) ((float)acosh((double)(x)))
|
|
49
|
+
#define atanhf(x) ((float)atanh((double)(x)))
|
|
50
|
+
#define logf(x) ((float)log((double)(x)))
|
|
51
|
+
#define log1pf(x) ((float)log1p((double)(x)))
|
|
52
|
+
#define log10f(x) ((float)log10((double)(x)))
|
|
53
|
+
#define log2f(x) ((float)log2((double)(x)))
|
|
54
|
+
#define expf(x) ((float)exp((double)(x)))
|
|
55
|
+
#define expm1f(x) ((float)expm1((double)(x)))
|
|
56
|
+
#define fabsf(x) ((float)fabs((double)(x)))
|
|
57
|
+
#define fmodf(x, y) ((float)fmod((double)(x), (double)(y)))
|
|
58
|
+
#define atan2f(x, y) ((float)atan2((double)(x), (double)(y)))
|
|
59
|
+
#define hypotf(x, y) ((float)hypot((double)(x), (double)(y)))
|
|
60
|
+
#define copysignf(x, y) ((float)copysign((double)(x), (double)(y)))
|
|
61
|
+
#define nextafterf(x, y) ((float)nextafter((double)(x), (double)(y)))
|
|
62
|
+
#define ceilf(x) ((float)ceil((double)(x)))
|
|
63
|
+
#define hypotf(x) ((float)hypot((double)(x)))
|
|
64
|
+
#define rintf(x) ((float)rint((double)(x)))
|
|
65
|
+
#define truncf(x) ((float)trunc((double)(x)))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
/* The next are directly called from interp_body.cpp */
|
|
69
|
+
#define powf(x, y) ((float)pow((double)(x), (double)(y)))
|
|
70
|
+
#define floorf(x) ((float)floor((double)(x)))
|
|
71
|
+
|
|
72
|
+
#define fmaxf_(x, y) ((float)fmaxd((double)(x), (double)(y))) // define fmaxf_ since fmaxf doesn't exist for early MSVC
|
|
73
|
+
#define fminf_(x, y) ((float)fmind((double)(x), (double)(y)))
|
|
74
|
+
#else
|
|
75
|
+
inline float fmaxf_(float x, float y) { return (isnanf_(x) | isnanf_(y))? NAN : fmaxf(x, y); }
|
|
76
|
+
inline float fminf_(float x, float y) { return (isnanf_(x) | isnanf_(y))? NAN : fminf(x, y); }
|
|
77
|
+
#endif // _MSC_VER < 1400
|
|
78
|
+
|
|
79
|
+
|
|
70
80
|
/* Now the actual stubs */
|
|
71
81
|
|
|
72
82
|
inline float sqrtf2(float x) {
|
|
@@ -170,11 +180,11 @@ inline float copysignf2(float x, float y) {
|
|
|
170
180
|
}
|
|
171
181
|
|
|
172
182
|
inline float fmaxf2(float x, float y) {
|
|
173
|
-
return
|
|
183
|
+
return fmaxf_(x, y);
|
|
174
184
|
}
|
|
175
185
|
|
|
176
186
|
inline float fminf2(float x, float y) {
|
|
177
|
-
return
|
|
187
|
+
return fminf_(x, y);
|
|
178
188
|
}
|
|
179
189
|
|
|
180
190
|
|
|
@@ -43,9 +43,7 @@
|
|
|
43
43
|
#include <cmath>
|
|
44
44
|
//no single precision version of signbit in C++ standard
|
|
45
45
|
inline bool signbitf(float x) { return signbit((double)x); }
|
|
46
|
-
|
|
47
|
-
inline double fmaxd(double x, double y) { return fmax(x, y); }
|
|
48
|
-
inline double fmind(double x, double y) { return fmin(x, y); }
|
|
46
|
+
|
|
49
47
|
#ifdef _WIN32
|
|
50
48
|
#ifndef __MINGW32__
|
|
51
49
|
#include "missing_posix_functions.hpp"
|
|
@@ -62,6 +60,12 @@ inline bool isfinited(double x) { return !!std::isfinite(x); }
|
|
|
62
60
|
inline bool isnand(double x) { return !!std::isnan(x); }
|
|
63
61
|
inline bool isinff_(float x) { return !!std::isinf(x); }
|
|
64
62
|
inline bool isinfd(double x) { return !!std::isinf(x); }
|
|
63
|
+
|
|
64
|
+
// To handle overloading of fmax/fmin in cmath and match NumPy behaviour for NaNs
|
|
65
|
+
inline double fmaxd(double x, double y) { return (isnand(x) | isnand(y))? NAN : fmax(x, y); }
|
|
66
|
+
inline double fmind(double x, double y) { return (isnand(x) | isnand(y))? NAN : fmin(x, y); }
|
|
67
|
+
inline float fmaxf_(float x, float y) { return (isnanf_(x) | isnanf_(y))? NAN : fmaxf(x, y); }
|
|
68
|
+
inline float fminf_(float x, float y) { return (isnanf_(x) | isnanf_(y))? NAN : fminf(x, y); }
|
|
65
69
|
#endif
|
|
66
70
|
|
|
67
71
|
#endif // NUMEXPR_CONFIG_HPP
|
|
@@ -484,9 +484,24 @@ class test_evaluate(TestCase):
|
|
|
484
484
|
for dtype in [float, double, int, np.int64]:
|
|
485
485
|
x = arange(10, dtype=dtype)
|
|
486
486
|
y = 2 * arange(10, dtype=dtype)[::-1]
|
|
487
|
+
if dtype in (float, double):
|
|
488
|
+
y[5] = np.nan
|
|
489
|
+
x[2] = np.nan
|
|
487
490
|
assert_array_equal(evaluate("maximum(x,y)"), maximum(x,y))
|
|
488
491
|
assert_array_equal(evaluate("minimum(x,y)"), minimum(x,y))
|
|
489
492
|
|
|
493
|
+
def test_addmult_booleans(self):
|
|
494
|
+
x = np.asarray([0, 1, 0, 0, 1], dtype=bool)
|
|
495
|
+
y = x[::-1]
|
|
496
|
+
res_ne = evaluate("x * y")
|
|
497
|
+
res_np = x * y
|
|
498
|
+
assert_array_equal(res_ne, res_np)
|
|
499
|
+
assert res_ne.dtype == res_np.dtype
|
|
500
|
+
res_ne = evaluate("x + y")
|
|
501
|
+
res_np = x + y
|
|
502
|
+
assert_array_equal(res_ne, res_np)
|
|
503
|
+
assert res_ne.dtype == res_np.dtype
|
|
504
|
+
|
|
490
505
|
def test_sign_round(self):
|
|
491
506
|
for dtype in [float, double, np.int32, np.int64, complex]:
|
|
492
507
|
x = arange(10, dtype=dtype)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: numexpr
|
|
3
|
-
Version: 2.13.
|
|
3
|
+
Version: 2.13.1
|
|
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>
|
numexpr-2.13.0/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.13.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|