Skip to content

Commit d1422d3

Browse files
committed
MAINT: Make NPY_RELAXED_STRIDE_CHECKING true by default.
1 parent 46c7211 commit d1422d3

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ matrix:
1717
- python: 3.3
1818
env: NPY_SEPARATE_COMPILATION=0
1919
- python: 2.7
20-
env: NPY_RELAXED_STRIDES_CHECKING=1
20+
env: NPY_RELAXED_STRIDES_CHECKING=0
2121
- python: 3.3
22-
env: NPY_RELAXED_STRIDES_CHECKING=1
22+
env: NPY_RELAXED_STRIDES_CHECKING=0
2323
- python: 2.7
2424
env: USE_BENTO=1
2525
before_install:

doc/release/1.10.0-notes.rst

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Future Changes
1919

2020
Compatibility notes
2121
===================
22+
NPY_RELAXED_STRIDE_CHECKING is now true by default.
2223

2324

2425
New Features

numpy/core/bscript

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ from setup_common \
2828
MANDATORY_FUNCS, C_ABI_VERSION, C_API_VERSION
2929

3030
ENABLE_SEPARATE_COMPILATION = (os.environ.get('NPY_SEPARATE_COMPILATION', "1") != "0")
31-
NPY_RELAXED_STRIDES_CHECKING = (os.environ.get('NPY_RELAXED_STRIDES_CHECKING', "0") != "0")
31+
NPY_RELAXED_STRIDES_CHECKING = (os.environ.get('NPY_RELAXED_STRIDES_CHECKING', "1") != "0")
3232

3333
NUMPYCONFIG_SYM = []
3434

numpy/core/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
ENABLE_SEPARATE_COMPILATION = (os.environ.get('NPY_SEPARATE_COMPILATION', "1") != "0")
2020
# Set to True to enable relaxed strides checking. This (mostly) means
2121
# that `strides[dim]` is ignored if `shape[dim] == 1` when setting flags.
22-
NPY_RELAXED_STRIDES_CHECKING = (os.environ.get('NPY_RELAXED_STRIDES_CHECKING', "0") != "0")
22+
NPY_RELAXED_STRIDES_CHECKING = (os.environ.get('NPY_RELAXED_STRIDES_CHECKING', "1") != "0")
2323

2424
# XXX: ugly, we use a class to avoid calling twice some expensive functions in
2525
# config.h/numpyconfig.h. I don't see a better way because distutils force

tools/test-installed-numpy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# Check that NPY_RELAXED_STRIDES_CHECKING is active when set.
4040
# The same flags check is also used in the tests to switch behavior.
41-
if (os.environ.get('NPY_RELAXED_STRIDES_CHECKING', "0") != "0"):
41+
if (os.environ.get('NPY_RELAXED_STRIDES_CHECKING', "1") != "0"):
4242
if not numpy.ones((10, 1), order='C').flags.f_contiguous:
4343
print('NPY_RELAXED_STRIDES_CHECKING set, but not active.')
4444
sys.exit(1)

tox.ini

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# installed and that they can be run as 'python2.7', 'python3.3', etc.
2626

2727
[tox]
28-
envlist = py26,py27,py32,py33,py27-monolithic,py33-monolithic,py27-relaxed-strides,py33-relaxed-strides
28+
envlist = py26,py27,py32,py33,py27-monolithic,py33-monolithic,py27-not-relaxed-strides,py33-not-relaxed-strides
2929

3030
[testenv]
3131
deps=
@@ -41,13 +41,13 @@ env=NPY_SEPARATE_COMPILATION=0
4141
basepython=python3.3
4242
env=NPY_SEPARATE_COMPILATION=0
4343

44-
[testenv:py27-relaxed-strides]
44+
[testenv:py27-not-relaxed-strides]
4545
basepython=python2.7
46-
env=NPY_RELAXED_STRIDES_CHECKING=1
46+
env=NPY_RELAXED_STRIDES_CHECKING=0
4747

48-
[testenv:py33-relaxed-strides]
48+
[testenv:py33-not-relaxed-strides]
4949
basepython=python3.3
50-
env=NPY_RELAXED_STRIDES_CHECKING=1
50+
env=NPY_RELAXED_STRIDES_CHECKING=0
5151

5252
# Not run by default. Set up the way you want then use 'tox -e debug'
5353
# if you want it:

0 commit comments

Comments
 (0)