summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2021-04-19 15:19:24 -0500
committerSebastian Berg <sebastian@sipsolutions.net>2021-05-12 15:33:34 -0700
commit834b1184c1f609a4e9ba06c55ea64ba882e4cdc1 (patch)
treed7bcb87952969fabddffe2a7e445f13f44b2ae34 /numpy
parentaaaa9753277ff9d387beecaf0f43519eacdea4eb (diff)
downloadnumpy-834b1184c1f609a4e9ba06c55ea64ba882e4cdc1.tar.gz
MAINT: Remove `NPY_USE_NEW_CASTINGIMPL`
This doesn't serve any purpose anymore. The new code is now always used. (In very few cases this may lead to small slowdowns, this should only matter in ufuncs where it doesn't seem to matter enough to worry about it.)
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/setup.py11
-rw-r--r--numpy/core/tests/test_shape_base.py8
2 files changed, 2 insertions, 17 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index 2af2426dd..b03e9f990 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -23,11 +23,6 @@ NPY_RELAXED_STRIDES_CHECKING = (os.environ.get('NPY_RELAXED_STRIDES_CHECKING', "
NPY_RELAXED_STRIDES_DEBUG = (os.environ.get('NPY_RELAXED_STRIDES_DEBUG', "0") != "0")
NPY_RELAXED_STRIDES_DEBUG = NPY_RELAXED_STRIDES_DEBUG and NPY_RELAXED_STRIDES_CHECKING
-# Set to True to use the new casting implementation as much as implemented.
-# Allows running the full test suit to exercise the new machinery until
-# it is used as default and the old version is eventually deleted.
-NPY_USE_NEW_CASTINGIMPL = os.environ.get('NPY_USE_NEW_CASTINGIMPL', "0") != "0"
-
# XXX: ugly, we use a class to avoid calling twice some expensive functions in
# config.h/numpyconfig.h. I don't see a better way because distutils force
# config.h generation inside an Extension class, and as such sharing
@@ -472,12 +467,6 @@ def configuration(parent_package='',top_path=None):
else:
moredefs.append(('NPY_RELAXED_STRIDES_DEBUG', 0))
- # Use the new experimental casting implementation in NumPy 1.20:
- if NPY_USE_NEW_CASTINGIMPL:
- moredefs.append(('NPY_USE_NEW_CASTINGIMPL', 1))
- else:
- moredefs.append(('NPY_USE_NEW_CASTINGIMPL', 0))
-
# Get long double representation
rep = check_long_double_representation(config_cmd)
moredefs.append(('HAVE_LDOUBLE_%s' % rep, 1))
diff --git a/numpy/core/tests/test_shape_base.py b/numpy/core/tests/test_shape_base.py
index a0c72f9d0..679e3c036 100644
--- a/numpy/core/tests/test_shape_base.py
+++ b/numpy/core/tests/test_shape_base.py
@@ -382,13 +382,9 @@ class TestConcatenate:
@pytest.mark.parametrize("axis", [None, 0])
def test_string_dtype_does_not_inspect(self, axis):
- # The error here currently depends on NPY_USE_NEW_CASTINGIMPL as
- # the new version rejects using the "default string length" of 64.
- # The new behaviour is better, `np.array()` and `arr.astype()` would
- # have to be used instead. (currently only raises due to unsafe cast)
- with pytest.raises((ValueError, TypeError)):
+ with pytest.raises(TypeError):
np.concatenate(([None], [1]), dtype="S", axis=axis)
- with pytest.raises((ValueError, TypeError)):
+ with pytest.raises(TypeError):
np.concatenate(([None], [1]), dtype="U", axis=axis)
@pytest.mark.parametrize("axis", [None, 0])