Skip to content

Commit 2372d27

Browse files
Francesc Altedjreback
Francesc Alted
authored andcommitted
BLD: Numexpr 2.4.6 required
closes #15213 Author: Francesc Alted <[email protected]> Closes #15383 from FrancescAlted/numexpr-2.4.6 and squashes the following commits: c417fe2 [Francesc Alted] Simplify and remove UserWarning testing on numexpr import e1b34a9 [Francesc Alted] Force a reload of pd.computation for actually triggering the UserWarning c081199 [Francesc Alted] Relax the exact message for the ImportError 73f0319 [Francesc Alted] numexpr requisite raised to 2.4.6 0d4ab9a [Francesc Alted] Restored the old numexpr version dependencies to adjust for old requirements c1aae19 [Francesc Alted] Fixed a lint error 7575ba2 [Francesc Alted] Using constants instead of literals for numexpr version 7a275ce [Francesc Alted] Fixed a typo 93f54aa [Francesc Alted] numexpr section moved to Other API changes section 3b6e58b [Francesc Alted] Removed recomendation for numexpr 2.6.2 f225598 [Francesc Alted] Updated test_compat for numexpr 2.4.6 8bd4ed1 [Francesc Alted] numexpr 2.4.6 requirement moved to other enhancements section e45b742 [Francesc Alted] Moved pinned versions in CI folder to 2.4.6 6e12e29 [Francesc Alted] Added a notice on the recommended numexpr version ac62653 [Francesc Alted] Require numexpr 2.4.6 ab79c54 [Francesc Alted] Require numexpr 2.6.2
1 parent bbb583c commit 2372d27

File tree

5 files changed

+14
-26
lines changed

5 files changed

+14
-26
lines changed

ci/requirements-3.4_SLOW.run

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ html5lib
99
patsy
1010
beautiful-soup
1111
scipy
12-
numexpr=2.4.4
12+
numexpr=2.4.6
1313
pytables
1414
matplotlib
1515
lxml

doc/source/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Recommended Dependencies
226226

227227
* `numexpr <https://github.com/pydata/numexpr>`__: for accelerating certain numerical operations.
228228
``numexpr`` uses multiple cores as well as smart chunking and caching to achieve large speedups.
229-
If installed, must be Version 2.1 or higher (excluding a buggy 2.4.4). Version 2.4.6 or higher is highly recommended.
229+
If installed, must be Version 2.4.6 or higher.
230230

231231
* `bottleneck <http://berkeleyanalytics.com/bottleneck>`__: for accelerating certain types of ``nan``
232232
evaluations. ``bottleneck`` uses specialized cython routines to achieve large speedups.

doc/source/whatsnew/v0.20.0.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _whatsnew_0200:
22

3-
v0.20.0 (????, 2016)
3+
v0.20.0 (????, 2017)
44
--------------------
55

66
This is a major release from 0.19 and includes a small number of API changes, several new features,
@@ -158,6 +158,7 @@ Other enhancements
158158

159159
.. _whatsnew_0200.api_breaking:
160160

161+
161162
Backwards incompatible API changes
162163
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
163164

@@ -429,6 +430,7 @@ Other API Changes
429430
- ``DataFrame.asof()`` will return a null filled ``Series`` instead the scalar ``NaN`` if a match is not found (:issue:`15118`)
430431
- The :func:`pd.read_gbq` method now stores ``INTEGER`` columns as ``dtype=object`` if they contain ``NULL`` values. Otherwise they are stored as ``int64``. This prevents precision lost for integers greather than 2**53. Furthermore ``FLOAT`` columns with values above 10**4 are no more casted to ``int64`` which also caused precision lost (:issue: `14064`, :issue:`14305`).
431432
- Reorganization of timeseries development tests (:issue:`14854`)
433+
- ``numexpr`` version is now required to be >= 2.4.6 and it will not be used at all if this requisite is not fulfilled (:issue:`15213`).
432434

433435
.. _whatsnew_0200.deprecations:
434436

pandas/computation/__init__.py

+5-12
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,19 @@
33
from distutils.version import LooseVersion
44

55
_NUMEXPR_INSTALLED = False
6+
_MIN_NUMEXPR_VERSION = "2.4.6"
67

78
try:
89
import numexpr as ne
910
ver = ne.__version__
10-
_NUMEXPR_INSTALLED = ver >= LooseVersion('2.1')
11+
_NUMEXPR_INSTALLED = ver >= LooseVersion(_MIN_NUMEXPR_VERSION)
1112

12-
# we specifically disallow 2.4.4 as
13-
# has some hard-to-diagnose bugs
14-
if ver == LooseVersion('2.4.4'):
15-
_NUMEXPR_INSTALLED = False
16-
warnings.warn(
17-
"The installed version of numexpr {ver} is not supported "
18-
"in pandas and will be not be used\n".format(ver=ver),
19-
UserWarning)
20-
21-
elif not _NUMEXPR_INSTALLED:
13+
if not _NUMEXPR_INSTALLED:
2214
warnings.warn(
2315
"The installed version of numexpr {ver} is not supported "
2416
"in pandas and will be not be used\nThe minimum supported "
25-
"version is 2.1\n".format(ver=ver), UserWarning)
17+
"version is {min_ver}\n".format(
18+
ver=ver, min_ver=_MIN_NUMEXPR_VERSION), UserWarning)
2619

2720
except ImportError: # pragma: no cover
2821
pass

pandas/tests/computation/test_compat.py

+4-11
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from pandas.computation.engines import _engines
1212
import pandas.computation.expr as expr
13+
from pandas.computation import _MIN_NUMEXPR_VERSION
1314

1415
ENGINES_PARSERS = list(product(_engines, expr._parsers))
1516

@@ -21,15 +22,10 @@ def test_compat():
2122
try:
2223
import numexpr as ne
2324
ver = ne.__version__
24-
if ver == LooseVersion('2.4.4'):
25+
if ver < LooseVersion(_MIN_NUMEXPR_VERSION):
2526
assert not _NUMEXPR_INSTALLED
26-
elif ver < LooseVersion('2.1'):
27-
with tm.assert_produces_warning(UserWarning,
28-
check_stacklevel=False):
29-
assert not _NUMEXPR_INSTALLED
3027
else:
3128
assert _NUMEXPR_INSTALLED
32-
3329
except ImportError:
3430
pytest.skip("not testing numexpr version compat")
3531

@@ -51,12 +47,9 @@ def testit():
5147
except ImportError:
5248
pytest.skip("no numexpr")
5349
else:
54-
if ne.__version__ < LooseVersion('2.1'):
55-
with tm.assertRaisesRegexp(ImportError, "'numexpr' version is "
56-
".+, must be >= 2.1"):
50+
if ne.__version__ < LooseVersion(_MIN_NUMEXPR_VERSION):
51+
with tm.assertRaises(ImportError):
5752
testit()
58-
elif ne.__version__ == LooseVersion('2.4.4'):
59-
pytest.skip("numexpr version==2.4.4")
6053
else:
6154
testit()
6255
else:

0 commit comments

Comments
 (0)