summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2020-12-31 09:33:12 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2020-12-31 09:33:12 +0900
commit1101483834e74c852752cfc7aad48d30940f0a1a (patch)
tree2b1907274ca3b5b5cc12c2bef6a60a8eebfe89b9
parentdafde1312a74de106e0e114de78b9ae5f52f0b78 (diff)
downloadpython-numpy-1101483834e74c852752cfc7aad48d30940f0a1a.tar.gz
python-numpy-1101483834e74c852752cfc7aad48d30940f0a1a.tar.bz2
python-numpy-1101483834e74c852752cfc7aad48d30940f0a1a.zip
Imported Upstream version 1.15.2upstream/1.15.2
-rw-r--r--doc/changelog/1.14.6-changelog.rst21
-rw-r--r--doc/changelog/1.15.2-changelog.rst21
-rw-r--r--doc/release/1.14.6-notes.rst33
-rw-r--r--doc/release/1.15.2-notes.rst45
-rw-r--r--doc/source/release.rst2
-rw-r--r--numpy/core/src/multiarray/alloc.c9
-rw-r--r--numpy/core/src/multiarray/convert_datatype.c14
-rw-r--r--numpy/core/src/multiarray/item_selection.c22
-rw-r--r--numpy/core/src/multiarray/mapping.c2
-rw-r--r--numpy/core/tests/test_indexing.py30
-rw-r--r--numpy/matrixlib/tests/test_defmatrix.py16
-rw-r--r--numpy/matrixlib/tests/test_interaction.py8
-rw-r--r--numpy/matrixlib/tests/test_masked_matrix.py9
-rw-r--r--numpy/matrixlib/tests/test_matrix_linalg.py8
-rw-r--r--numpy/matrixlib/tests/test_multiarray.py8
-rw-r--r--numpy/matrixlib/tests/test_numeric.py8
-rw-r--r--numpy/matrixlib/tests/test_regression.py8
-rw-r--r--numpy/testing/_private/pytesttester.py23
-rw-r--r--pavement.py4
-rw-r--r--pytest.ini5
-rwxr-xr-xsetup.py2
21 files changed, 220 insertions, 78 deletions
diff --git a/doc/changelog/1.14.6-changelog.rst b/doc/changelog/1.14.6-changelog.rst
new file mode 100644
index 000000000..be396208d
--- /dev/null
+++ b/doc/changelog/1.14.6-changelog.rst
@@ -0,0 +1,21 @@
+
+Contributors
+============
+
+A total of 4 people contributed to this release. People with a "+" by their
+names contributed a patch for the first time.
+
+* Charles Harris
+* Eric Wieser
+* Julian Taylor
+* Matti Picus
+
+Pull requests merged
+====================
+
+A total of 4 pull requests were merged for this release.
+
+* `#11985 <https://github.com/numpy/numpy/pull/11985>`__: BUG: fix cached allocations without the GIL
+* `#11986 <https://github.com/numpy/numpy/pull/11986>`__: BUG: Undo behavior change in ma.masked_values(shrink=True)
+* `#11987 <https://github.com/numpy/numpy/pull/11987>`__: BUG: fix refcount leak in PyArray_AdaptFlexibleDType
+* `#11995 <https://github.com/numpy/numpy/pull/11995>`__: TST: Add Python 3.7 testing to NumPy 1.14.
diff --git a/doc/changelog/1.15.2-changelog.rst b/doc/changelog/1.15.2-changelog.rst
new file mode 100644
index 000000000..b4589c56d
--- /dev/null
+++ b/doc/changelog/1.15.2-changelog.rst
@@ -0,0 +1,21 @@
+
+Contributors
+============
+
+A total of 4 people contributed to this release. People with a "+" by their
+names contributed a patch for the first time.
+
+* Charles Harris
+* Julian Taylor
+* Marten van Kerkwijk
+* Matti Picus
+
+Pull requests merged
+====================
+
+A total of 4 pull requests were merged for this release.
+
+* `#11902 <https://github.com/numpy/numpy/pull/11902>`__: BUG: Fix matrix PendingDeprecationWarning suppression for pytest...
+* `#11981 <https://github.com/numpy/numpy/pull/11981>`__: BUG: fix cached allocations without the GIL for 1.15.x
+* `#11982 <https://github.com/numpy/numpy/pull/11982>`__: BUG: fix refcount leak in PyArray_AdaptFlexibleDType
+* `#11992 <https://github.com/numpy/numpy/pull/11992>`__: BUG: Ensure boolean indexing of subclasses sets base correctly.
diff --git a/doc/release/1.14.6-notes.rst b/doc/release/1.14.6-notes.rst
new file mode 100644
index 000000000..ac6a78272
--- /dev/null
+++ b/doc/release/1.14.6-notes.rst
@@ -0,0 +1,33 @@
+==========================
+NumPy 1.14.6 Release Notes
+==========================
+
+This is a bugfix release for bugs reported following the 1.14.5 release. The
+most significant fixes are:
+
+* Fix for behavior change in ``ma.masked_values(shrink=True)``
+* Fix the new cached allocations machinery to be thread safe.
+
+The Python versions supported in this release are 2.7 and 3.4 - 3.7. The Python
+3.6 wheels on PyPI should be compatible with all Python 3.6 versions.
+
+Contributors
+============
+
+A total of 4 people contributed to this release. People with a "+" by their
+names contributed a patch for the first time.
+
+* Charles Harris
+* Eric Wieser
+* Julian Taylor
+* Matti Picus
+
+Pull requests merged
+====================
+
+A total of 4 pull requests were merged for this release.
+
+* `#11985 <https://github.com/numpy/numpy/pull/11985>`__: BUG: fix cached allocations without the GIL
+* `#11986 <https://github.com/numpy/numpy/pull/11986>`__: BUG: Undo behavior change in ma.masked_values(shrink=True)
+* `#11987 <https://github.com/numpy/numpy/pull/11987>`__: BUG: fix refcount leak in PyArray_AdaptFlexibleDType
+* `#11995 <https://github.com/numpy/numpy/pull/11995>`__: TST: Add Python 3.7 testing to NumPy 1.14.
diff --git a/doc/release/1.15.2-notes.rst b/doc/release/1.15.2-notes.rst
new file mode 100644
index 000000000..a3e61fccd
--- /dev/null
+++ b/doc/release/1.15.2-notes.rst
@@ -0,0 +1,45 @@
+==========================
+NumPy 1.15.2 Release Notes
+==========================
+
+This is a bugfix release for bugs and regressions reported following the 1.15.1
+release.
+
+* The matrix PendingDeprecationWarning is now suppressed in pytest 3.8.
+* The new cached allocations machinery has been fixed to be thread safe.
+* The boolean indexing of subclasses now works correctly.
+* A small memory leak in PyArray_AdaptFlexibleDType has been fixed.
+
+The Python versions supported by this release are 2.7, 3.4-3.7. The wheels are
+linked with OpenBLAS v0.3.0, which should fix some of the linalg problems
+reported for NumPy 1.14.
+
+Compatibility Note
+==================
+
+The NumPy 1.15.x OS X wheels released on PyPI no longer contain 32-bit
+binaries. That will also be the case in future releases. See
+`#11625 <https://github.com/numpy/numpy/issues/11625>`__ for the related
+discussion. Those needing 32-bit support should look elsewhere or build
+from source.
+
+Contributors
+============
+
+A total of 4 people contributed to this release. People with a "+" by their
+names contributed a patch for the first time.
+
+* Charles Harris
+* Julian Taylor
+* Marten van Kerkwijk
+* Matti Picus
+
+Pull requests merged
+====================
+
+A total of 4 pull requests were merged for this release.
+
+* `#11902 <https://github.com/numpy/numpy/pull/11902>`__: BUG: Fix matrix PendingDeprecationWarning suppression for pytest...
+* `#11981 <https://github.com/numpy/numpy/pull/11981>`__: BUG: fix cached allocations without the GIL for 1.15.x
+* `#11982 <https://github.com/numpy/numpy/pull/11982>`__: BUG: fix refcount leak in PyArray_AdaptFlexibleDType
+* `#11992 <https://github.com/numpy/numpy/pull/11992>`__: BUG: Ensure boolean indexing of subclasses sets base correctly.
diff --git a/doc/source/release.rst b/doc/source/release.rst
index fb20fce92..637391010 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -2,8 +2,10 @@
Release Notes
*************
+.. include:: ../release/1.15.2-notes.rst
.. include:: ../release/1.15.1-notes.rst
.. include:: ../release/1.15.0-notes.rst
+.. include:: ../release/1.14.6-notes.rst
.. include:: ../release/1.14.5-notes.rst
.. include:: ../release/1.14.4-notes.rst
.. include:: ../release/1.14.3-notes.rst
diff --git a/numpy/core/src/multiarray/alloc.c b/numpy/core/src/multiarray/alloc.c
index ae4b81cf5..fe957bf16 100644
--- a/numpy/core/src/multiarray/alloc.c
+++ b/numpy/core/src/multiarray/alloc.c
@@ -35,6 +35,13 @@ typedef struct {
static cache_bucket datacache[NBUCKETS];
static cache_bucket dimcache[NBUCKETS_DIM];
+/* as the cache is managed in global variables verify the GIL is held */
+#if defined(NPY_PY3K)
+#define NPY_CHECK_GIL_HELD() PyGILState_Check()
+#else
+#define NPY_CHECK_GIL_HELD() 1
+#endif
+
/*
* very simplistic small memory block cache to avoid more expensive libc
* allocations
@@ -47,6 +54,7 @@ _npy_alloc_cache(npy_uintp nelem, npy_uintp esz, npy_uint msz,
{
assert((esz == 1 && cache == datacache) ||
(esz == sizeof(npy_intp) && cache == dimcache));
+ assert(NPY_CHECK_GIL_HELD());
if (nelem < msz) {
if (cache[nelem].available > 0) {
return cache[nelem].ptrs[--(cache[nelem].available)];
@@ -75,6 +83,7 @@ static NPY_INLINE void
_npy_free_cache(void * p, npy_uintp nelem, npy_uint msz,
cache_bucket * cache, void (*dealloc)(void *))
{
+ assert(NPY_CHECK_GIL_HELD());
if (p != NULL && nelem < msz) {
if (cache[nelem].available < NCACHE) {
cache[nelem].ptrs[cache[nelem].available++] = p;
diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c
index 0d79f294c..3df764a48 100644
--- a/numpy/core/src/multiarray/convert_datatype.c
+++ b/numpy/core/src/multiarray/convert_datatype.c
@@ -149,11 +149,6 @@ PyArray_AdaptFlexibleDType(PyObject *data_obj, PyArray_Descr *data_dtype,
{
PyArray_DatetimeMetaData *meta;
int flex_type_num;
- PyArrayObject *arr = NULL;
- PyArray_Descr *dtype = NULL;
- int ndim = 0;
- npy_intp dims[NPY_MAXDIMS];
- int result;
if (*flex_dtype == NULL) {
if (!PyErr_Occurred()) {
@@ -168,7 +163,7 @@ PyArray_AdaptFlexibleDType(PyObject *data_obj, PyArray_Descr *data_dtype,
/* Flexible types with expandable size */
if (PyDataType_ISUNSIZED(*flex_dtype)) {
- /* First replace the flex dtype */
+ /* First replace the flex_dtype */
PyArray_DESCR_REPLACE(*flex_dtype);
if (*flex_dtype == NULL) {
return;
@@ -259,6 +254,11 @@ PyArray_AdaptFlexibleDType(PyObject *data_obj, PyArray_Descr *data_dtype,
* GetArrayParamsFromObject won't iterate over
* array.
*/
+ PyArray_Descr *dtype = NULL;
+ PyArrayObject *arr = NULL;
+ int result;
+ int ndim = 0;
+ npy_intp dims[NPY_MAXDIMS];
list = PyArray_ToList((PyArrayObject *)data_obj);
result = PyArray_GetArrayParamsFromObject(
list,
@@ -273,6 +273,8 @@ PyArray_AdaptFlexibleDType(PyObject *data_obj, PyArray_Descr *data_dtype,
size = dtype->elsize;
}
}
+ Py_XDECREF(dtype);
+ Py_XDECREF(arr);
Py_DECREF(list);
}
else if (PyArray_IsPythonScalar(data_obj)) {
diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c
index 141b2d922..925585704 100644
--- a/numpy/core/src/multiarray/item_selection.c
+++ b/numpy/core/src/multiarray/item_selection.c
@@ -833,8 +833,6 @@ _new_sortlike(PyArrayObject *op, int axis, PyArray_SortFunc *sort,
}
size = it->size;
- NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(op));
-
if (needcopy) {
buffer = npy_alloc_cache(N * elsize);
if (buffer == NULL) {
@@ -843,6 +841,8 @@ _new_sortlike(PyArrayObject *op, int axis, PyArray_SortFunc *sort,
}
}
+ NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(op));
+
while (size--) {
char *bufptr = it->dataptr;
@@ -917,8 +917,8 @@ _new_sortlike(PyArrayObject *op, int axis, PyArray_SortFunc *sort,
}
fail:
- npy_free_cache(buffer, N * elsize);
NPY_END_THREADS_DESCR(PyArray_DESCR(op));
+ npy_free_cache(buffer, N * elsize);
if (ret < 0 && !PyErr_Occurred()) {
/* Out of memory during sorting or buffer creation */
PyErr_NoMemory();
@@ -979,8 +979,6 @@ _new_argsortlike(PyArrayObject *op, int axis, PyArray_ArgSortFunc *argsort,
}
size = it->size;
- NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(op));
-
if (needcopy) {
valbuffer = npy_alloc_cache(N * elsize);
if (valbuffer == NULL) {
@@ -997,6 +995,8 @@ _new_argsortlike(PyArrayObject *op, int axis, PyArray_ArgSortFunc *argsort,
}
}
+ NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(op));
+
while (size--) {
char *valptr = it->dataptr;
npy_intp *idxptr = (npy_intp *)rit->dataptr;
@@ -1080,9 +1080,9 @@ _new_argsortlike(PyArrayObject *op, int axis, PyArray_ArgSortFunc *argsort,
}
fail:
+ NPY_END_THREADS_DESCR(PyArray_DESCR(op));
npy_free_cache(valbuffer, N * elsize);
npy_free_cache(idxbuffer, N * sizeof(npy_intp));
- NPY_END_THREADS_DESCR(PyArray_DESCR(op));
if (ret < 0) {
if (!PyErr_Occurred()) {
/* Out of memory during sorting or buffer creation */
@@ -1498,13 +1498,13 @@ PyArray_LexSort(PyObject *sort_keys, int axis)
char *valbuffer, *indbuffer;
int *swaps;
- valbuffer = npy_alloc_cache(N * maxelsize);
+ valbuffer = PyDataMem_NEW(N * maxelsize);
if (valbuffer == NULL) {
goto fail;
}
- indbuffer = npy_alloc_cache(N * sizeof(npy_intp));
+ indbuffer = PyDataMem_NEW(N * sizeof(npy_intp));
if (indbuffer == NULL) {
- npy_free_cache(indbuffer, N * sizeof(npy_intp));
+ PyDataMem_FREE(indbuffer);
goto fail;
}
swaps = malloc(n*sizeof(int));
@@ -1547,8 +1547,8 @@ PyArray_LexSort(PyObject *sort_keys, int axis)
sizeof(npy_intp), N, sizeof(npy_intp));
PyArray_ITER_NEXT(rit);
}
- npy_free_cache(valbuffer, N * maxelsize);
- npy_free_cache(indbuffer, N * sizeof(npy_intp));
+ PyDataMem_FREE(valbuffer);
+ PyDataMem_FREE(indbuffer);
free(swaps);
}
else {
diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c
index f338226c2..246dbefd5 100644
--- a/numpy/core/src/multiarray/mapping.c
+++ b/numpy/core/src/multiarray/mapping.c
@@ -1125,7 +1125,7 @@ array_boolean_subscript(PyArrayObject *self,
ret = (PyArrayObject *)PyArray_NewFromDescrAndBase(
Py_TYPE(self), dtype,
1, &size, PyArray_STRIDES(ret), PyArray_BYTES(ret),
- PyArray_FLAGS(self), (PyObject *)self, (PyObject *)self);
+ PyArray_FLAGS(self), (PyObject *)self, (PyObject *)tmp);
if (ret == NULL) {
Py_DECREF(tmp);
diff --git a/numpy/core/tests/test_indexing.py b/numpy/core/tests/test_indexing.py
index 276cd9f93..fb5687328 100644
--- a/numpy/core/tests/test_indexing.py
+++ b/numpy/core/tests/test_indexing.py
@@ -581,15 +581,33 @@ class TestBroadcastedAssignments(object):
class TestSubclasses(object):
def test_basic(self):
+ # Test that indexing in various ways produces SubClass instances,
+ # and that the base is set up correctly: the original subclass
+ # instance for views, and a new ndarray for advanced/boolean indexing
+ # where a copy was made (latter a regression test for gh-11983).
class SubClass(np.ndarray):
pass
- s = np.arange(5).view(SubClass)
- assert_(isinstance(s[:3], SubClass))
- assert_(s[:3].base is s)
-
- assert_(isinstance(s[[0, 1, 2]], SubClass))
- assert_(isinstance(s[s > 0], SubClass))
+ a = np.arange(5)
+ s = a.view(SubClass)
+ s_slice = s[:3]
+ assert_(type(s_slice) is SubClass)
+ assert_(s_slice.base is s)
+ assert_array_equal(s_slice, a[:3])
+
+ s_fancy = s[[0, 1, 2]]
+ assert_(type(s_fancy) is SubClass)
+ assert_(s_fancy.base is not s)
+ assert_(type(s_fancy.base) is np.ndarray)
+ assert_array_equal(s_fancy, a[[0, 1, 2]])
+ assert_array_equal(s_fancy.base, a[[0, 1, 2]])
+
+ s_bool = s[s > 0]
+ assert_(type(s_bool) is SubClass)
+ assert_(s_bool.base is not s)
+ assert_(type(s_bool.base) is np.ndarray)
+ assert_array_equal(s_bool, a[a > 0])
+ assert_array_equal(s_bool.base, a[a > 0])
def test_finalize_gets_full_info(self):
# Array finalize should be called on the filled array.
diff --git a/numpy/matrixlib/tests/test_defmatrix.py b/numpy/matrixlib/tests/test_defmatrix.py
index e74e83cdb..4cff5ee9b 100644
--- a/numpy/matrixlib/tests/test_defmatrix.py
+++ b/numpy/matrixlib/tests/test_defmatrix.py
@@ -1,12 +1,6 @@
from __future__ import division, absolute_import, print_function
-# As we are testing matrices, we ignore its PendingDeprecationWarnings
-try:
- import pytest
- pytestmark = pytest.mark.filterwarnings(
- 'ignore:the matrix subclass is not:PendingDeprecationWarning')
-except ImportError:
- pass
+import pytest
try:
# Accessing collections abstract classes from collections
@@ -466,3 +460,11 @@ class TestShape(object):
def test_matrix_memory_sharing(self):
assert_(np.may_share_memory(self.m, self.m.ravel()))
assert_(not np.may_share_memory(self.m, self.m.flatten()))
+
+ def test_expand_dims_matrix(self):
+ # matrices are always 2d - so expand_dims only makes sense when the
+ # type is changed away from matrix.
+ a = np.arange(10).reshape((2, 5)).view(np.matrix)
+ expanded = np.expand_dims(a, axis=1)
+ assert_equal(expanded.ndim, 3)
+ assert_(not isinstance(expanded, np.matrix))
diff --git a/numpy/matrixlib/tests/test_interaction.py b/numpy/matrixlib/tests/test_interaction.py
index fb4d8f98c..088ae3c6a 100644
--- a/numpy/matrixlib/tests/test_interaction.py
+++ b/numpy/matrixlib/tests/test_interaction.py
@@ -4,13 +4,7 @@ Note that tests with MaskedArray and linalg are done in separate files.
"""
from __future__ import division, absolute_import, print_function
-# As we are testing matrices, we ignore its PendingDeprecationWarnings
-try:
- import pytest
- pytestmark = pytest.mark.filterwarnings(
- 'ignore:the matrix subclass is not:PendingDeprecationWarning')
-except ImportError:
- pass
+import pytest
import textwrap
import warnings
diff --git a/numpy/matrixlib/tests/test_masked_matrix.py b/numpy/matrixlib/tests/test_masked_matrix.py
index adc2e5419..5ed8044aa 100644
--- a/numpy/matrixlib/tests/test_masked_matrix.py
+++ b/numpy/matrixlib/tests/test_masked_matrix.py
@@ -1,14 +1,7 @@
from __future__ import division, absolute_import, print_function
-# As we are testing matrices, we ignore its PendingDeprecationWarnings
-try:
- import pytest
- pytestmark = pytest.mark.filterwarnings(
- 'ignore:the matrix subclass is not:PendingDeprecationWarning')
-except ImportError:
- pass
-
import pickle
+import pytest
import numpy as np
from numpy.ma.testutils import (assert_, assert_equal, assert_raises,
diff --git a/numpy/matrixlib/tests/test_matrix_linalg.py b/numpy/matrixlib/tests/test_matrix_linalg.py
index 85c7693b4..8d31ec5b0 100644
--- a/numpy/matrixlib/tests/test_matrix_linalg.py
+++ b/numpy/matrixlib/tests/test_matrix_linalg.py
@@ -1,13 +1,7 @@
""" Test functions for linalg module using the matrix class."""
from __future__ import division, absolute_import, print_function
-# As we are testing matrices, we ignore its PendingDeprecationWarnings
-try:
- import pytest
- pytestmark = pytest.mark.filterwarnings(
- 'ignore:the matrix subclass is not:PendingDeprecationWarning')
-except ImportError:
- pass
+import pytest
import numpy as np
diff --git a/numpy/matrixlib/tests/test_multiarray.py b/numpy/matrixlib/tests/test_multiarray.py
index 2f04b49d6..8de0a7c6a 100644
--- a/numpy/matrixlib/tests/test_multiarray.py
+++ b/numpy/matrixlib/tests/test_multiarray.py
@@ -1,12 +1,6 @@
from __future__ import division, absolute_import, print_function
-# As we are testing matrices, we ignore its PendingDeprecationWarnings
-try:
- import pytest
- pytestmark = pytest.mark.filterwarnings(
- 'ignore:the matrix subclass is not:PendingDeprecationWarning')
-except ImportError:
- pass
+import pytest
import numpy as np
from numpy.testing import assert_, assert_equal, assert_array_equal
diff --git a/numpy/matrixlib/tests/test_numeric.py b/numpy/matrixlib/tests/test_numeric.py
index cfdada126..e9f44e747 100644
--- a/numpy/matrixlib/tests/test_numeric.py
+++ b/numpy/matrixlib/tests/test_numeric.py
@@ -1,12 +1,6 @@
from __future__ import division, absolute_import, print_function
-# As we are testing matrices, we ignore its PendingDeprecationWarnings
-try:
- import pytest
- pytestmark = pytest.mark.filterwarnings(
- 'ignore:the matrix subclass is not:PendingDeprecationWarning')
-except ImportError:
- pass
+import pytest
import numpy as np
from numpy.testing import assert_equal
diff --git a/numpy/matrixlib/tests/test_regression.py b/numpy/matrixlib/tests/test_regression.py
index 439704ccf..88654c76a 100644
--- a/numpy/matrixlib/tests/test_regression.py
+++ b/numpy/matrixlib/tests/test_regression.py
@@ -1,12 +1,6 @@
from __future__ import division, absolute_import, print_function
-# As we are testing matrices, we ignore its PendingDeprecationWarnings
-try:
- import pytest
- pytestmark = pytest.mark.filterwarnings(
- 'ignore:the matrix subclass is not:PendingDeprecationWarning')
-except ImportError:
- pass
+import pytest
import numpy as np
from numpy.testing import assert_, assert_equal, assert_raises
diff --git a/numpy/testing/_private/pytesttester.py b/numpy/testing/_private/pytesttester.py
index 8c73fafa4..30ecc69c7 100644
--- a/numpy/testing/_private/pytesttester.py
+++ b/numpy/testing/_private/pytesttester.py
@@ -5,7 +5,7 @@ This module implements the ``test()`` function for NumPy modules. The usual
boiler plate for doing that is to put the following in the module
``__init__.py`` file::
- from numpy.testing import PytestTester
+ from numpy._pytesttester import PytestTester
test = PytestTester(__name__).test
del PytestTester
@@ -23,6 +23,9 @@ whether or not that file is found as follows:
In practice, tests run from the numpy repo are run in develop mode. That
includes the standard ``python runtests.py`` invocation.
+This module is imported by every numpy subpackage, so lies at the top level to
+simplify circular import issues. For the same reason, it contains no numpy
+imports at module scope, instead importing numpy within function calls.
"""
from __future__ import division, absolute_import, print_function
@@ -157,6 +160,24 @@ class PytestTester(object):
"-W ignore::UserWarning:cpuinfo",
]
+ # When testing matrices, ignore their PendingDeprecationWarnings
+ pytest_args += [
+ "-W ignore:the matrix subclass is not",
+ ]
+
+ # Ignore python2.7 -3 warnings
+ pytest_args += [
+ r"-W ignore:sys\.exc_clear\(\) not supported in 3\.x:DeprecationWarning",
+ r"-W ignore:in 3\.x, __setslice__:DeprecationWarning",
+ r"-W ignore:in 3\.x, __getslice__:DeprecationWarning",
+ r"-W ignore:buffer\(\) not supported in 3\.x:DeprecationWarning",
+ r"-W ignore:CObject type is not supported in 3\.x:DeprecationWarning",
+ r"-W ignore:comparing unequal types not supported in 3\.x:DeprecationWarning",
+ r"-W ignore:the commands module has been removed in Python 3\.0:DeprecationWarning",
+ r"-W ignore:The 'new' module has been removed in Python 3\.0:DeprecationWarning",
+ ]
+
+
if doctests:
raise ValueError("Doctests not supported")
diff --git a/pavement.py b/pavement.py
index 75bd98a5e..2fdc77deb 100644
--- a/pavement.py
+++ b/pavement.py
@@ -95,10 +95,10 @@ finally:
#-----------------------------------
# Source of the release notes
-RELEASE_NOTES = 'doc/release/1.15.1-notes.rst'
+RELEASE_NOTES = 'doc/release/1.15.2-notes.rst'
# Start/end of the log (from git)
-LOG_START = 'v1.15.0'
+LOG_START = 'v1.15.1'
LOG_END = 'maintenance/1.15.x'
diff --git a/pytest.ini b/pytest.ini
index 2423857b0..1a49e5dea 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -9,6 +9,9 @@ filterwarnings =
ignore:Not importing directory
ignore:numpy.dtype size changed
ignore:numpy.ufunc size changed
+ ignore::UserWarning:cpuinfo,
+# Matrix PendingDeprecationWarning.
+ ignore:the matrix subclass is not
# Ignore python2.7 -3 warnings
ignore:sys\.exc_clear\(\) not supported in 3\.x:DeprecationWarning
ignore:in 3\.x, __setslice__:DeprecationWarning
@@ -17,5 +20,7 @@ filterwarnings =
ignore:CObject type is not supported in 3\.x:DeprecationWarning
ignore:comparing unequal types not supported in 3\.x:DeprecationWarning
ignore:the commands module has been removed in Python 3\.0:DeprecationWarning
+ ignore:The 'new' module has been removed in Python 3\.0:DeprecationWarning
+
env =
PYTHONHASHSEED=0
diff --git a/setup.py b/setup.py
index fed178e1b..1642e6a57 100755
--- a/setup.py
+++ b/setup.py
@@ -64,7 +64,7 @@ Operating System :: MacOS
MAJOR = 1
MINOR = 15
-MICRO = 1
+MICRO = 2
ISRELEASED = True
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)