summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdoc/postprocess.py4
-rw-r--r--doc/release/1.8.0-notes.rst15
-rw-r--r--numpy/core/code_generators/cversions.py4
-rw-r--r--numpy/core/code_generators/cversions.txt2
-rw-r--r--numpy/core/code_generators/numpy_api.py3
-rw-r--r--numpy/core/fromnumeric.py6
-rw-r--r--numpy/core/setup_common.py5
-rw-r--r--numpy/core/src/multiarray/arrayobject.c2
8 files changed, 27 insertions, 14 deletions
diff --git a/doc/postprocess.py b/doc/postprocess.py
index f0ca22cd5..257f84806 100755
--- a/doc/postprocess.py
+++ b/doc/postprocess.py
@@ -23,7 +23,7 @@ def main():
p.error('unknown mode %s' % mode)
for fn in args:
- f = open(fn, 'r')
+ f = open(fn, 'r', encoding="utf-8")
try:
if mode == 'html':
lines = process_html(fn, f.readlines())
@@ -32,7 +32,7 @@ def main():
finally:
f.close()
- f = open(fn, 'w')
+ f = open(fn, 'w', encoding="utf-8")
f.write("".join(lines))
f.close()
diff --git a/doc/release/1.8.0-notes.rst b/doc/release/1.8.0-notes.rst
index 4b682a992..5923c7ea3 100644
--- a/doc/release/1.8.0-notes.rst
+++ b/doc/release/1.8.0-notes.rst
@@ -23,11 +23,6 @@ Support for SCons has been removed.
Compatibility notes
===================
-numpy.diag, np.diagonal, and the diagonal method of ndarrays return a view
-onto the original array, instead of producing a copy.
-
-selecting multiple fields out of an array also produces a view.
-
The hash function of numpy.void scalars has been changed. Previously the
pointer to the data was hashed as an integer. Now, the hash function uses
the tuple-hash algorithm to combine the hash functions of the elements of
@@ -107,6 +102,16 @@ Function `median` used with `overwrite_input` only partially sorts array
If `median` is used with `overwrite_input` option the input array will now only
be partially sorted instead of fully sorted.
+Fix to financial.npv
+~~~~~~~~~~~~~~~~~~~~
+
+The npv function had a bug. Contrary to what the documentation stated, it
+summed from indexes ``1`` to ``M`` instead of from ``0`` to ``M - 1``. The
+fix changes the returned value. The mirr function called the npv function,
+but worked around the problem, so that was also fixed and the return value
+of the mirr function remains unchanged.
+
+
New Features
============
diff --git a/numpy/core/code_generators/cversions.py b/numpy/core/code_generators/cversions.py
index 5ce0757c8..840251aa8 100644
--- a/numpy/core/code_generators/cversions.py
+++ b/numpy/core/code_generators/cversions.py
@@ -7,8 +7,8 @@ from __future__ import division, absolute_import, print_function
from os.path import dirname
-from .genapi import fullapi_hash
-from . import numpy_api
+from genapi import fullapi_hash
+import numpy_api
if __name__ == '__main__':
diff --git a/numpy/core/code_generators/cversions.txt b/numpy/core/code_generators/cversions.txt
index 5de3d5dc2..24d376ac6 100644
--- a/numpy/core/code_generators/cversions.txt
+++ b/numpy/core/code_generators/cversions.txt
@@ -15,3 +15,5 @@
0x00000007 = e396ba3912dcf052eaee1b0b203a7724
# Version 8 Added interface to MapIterObject
0x00000008 = 17321775fc884de0b1eda478cd61c74b
+# Version 9 Added interface for partition functions.
+0x00000009 = f99a02b75bd60205d1afe1eed080fd53
diff --git a/numpy/core/code_generators/numpy_api.py b/numpy/core/code_generators/numpy_api.py
index 134d6199e..ad9ee3eec 100644
--- a/numpy/core/code_generators/numpy_api.py
+++ b/numpy/core/code_generators/numpy_api.py
@@ -339,6 +339,7 @@ multiarray_funcs_api = {
'PyArray_Partition': 296,
'PyArray_ArgPartition': 297,
'PyArray_SelectkindConverter': 298,
+ # End 1.8 API
}
ufunc_types_api = {
@@ -388,7 +389,9 @@ ufunc_funcs_api = {
# End 1.6 API
'PyUFunc_DefaultTypeResolver': 39,
'PyUFunc_ValidateCasting': 40,
+ # End 1.7 API
'PyUFunc_RegisterLoopForDescr': 41,
+ # End 1.8 API
}
# List of all the dicts which define the C API
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index e325c5fd1..cb1c4ff05 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -1129,10 +1129,10 @@ def diagonal(a, offset=0, axis1=0, axis2=1):
on this fact is deprecated. Writing to the resulting array continues to
work as it used to, but a FutureWarning will be issued.
- In NumPy 1.8, it will switch to returning a read-only view on the original
+ In NumPy 1.9, it will switch to returning a read-only view on the original
array. Attempting to write to the resulting array will produce an error.
- In NumPy 1.9, it will still return a view, but this view will no longer be
+ In NumPy 1.10, it will still return a view, but this view will no longer be
marked read-only. Writing to the returned array will alter your original
array as well.
@@ -1302,7 +1302,7 @@ def ravel(a, order='C'):
Returns
-------
1d_array : ndarray
- Output of the same dtype as `a`, and of shape ``(a.size(),)``.
+ Output of the same dtype as `a`, and of shape ``(a.size,)``.
See Also
--------
diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py
index 9a630225d..7f0ad8bfe 100644
--- a/numpy/core/setup_common.py
+++ b/numpy/core/setup_common.py
@@ -31,7 +31,10 @@ C_ABI_VERSION = 0x01000009
# without breaking binary compatibility. In this case, only the C_API_VERSION
# (*not* C_ABI_VERSION) would be increased. Whenever binary compatibility is
# broken, both C_API_VERSION and C_ABI_VERSION should be increased.
-C_API_VERSION = 0x00000008
+#
+# 0x00000008 - 1.7.x
+# 0x00000009 - 1.8.x
+C_API_VERSION = 0x00000009
class MismatchCAPIWarning(Warning):
pass
diff --git a/numpy/core/src/multiarray/arrayobject.c b/numpy/core/src/multiarray/arrayobject.c
index 062b839aa..6db6060c9 100644
--- a/numpy/core/src/multiarray/arrayobject.c
+++ b/numpy/core/src/multiarray/arrayobject.c
@@ -705,7 +705,7 @@ array_might_be_written(PyArrayObject *obj)
const char *msg =
"Numpy has detected that you (may be) writing to an array returned\n"
"by numpy.diagonal or by selecting multiple fields in a record\n"
- "array. This code will likely break in the next numpy release --\n"
+ "array. This code will likely break in a future numpy release --\n"
"see numpy.diagonal or arrays.indexing reference docs for details.\n"
"The quick fix is to make an explicit copy (e.g., do\n"
"arr.diagonal().copy() or arr[['f0','f1']].copy()).";