1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
NumPy 1.10.0 Release Notes
**************************
This release supports Python 2.6 - 2.7 and 3.2 - 3.4.
Highlights
==========
* numpy.distutils now supports parallel compilation via the --jobs/-j argument
passed to setup.py build
* Addition of *np.linalg.multi_dot*: compute the dot product of two or more
arrays in a single function call, while automatically selecting the fastest
evaluation order.
* Addition of `nanprod` to the set of nanfunctions.
Dropped Support
===============
* The polytemplate.py file has been removed.
* The _dotblas module is no longer available.
* The testcalcs.py file has been removed.
Future Changes
==============
* The SafeEval class will be removed.
* The alterdot and restoredot functions will be removed.
Compatibility notes
===================
numpy version string
~~~~~~~~~~~~~~~~~~~~
The numpy version string for development builds has been changed from
``x.y.z.dev-githash`` to ``x.y.z.dev+githash`` (note the +) in order to comply
with PEP 440.
relaxed stride checking
~~~~~~~~~~~~~~~~~~~~~~~
NPY_RELAXED_STRIDE_CHECKING is now true by default.
*np.ravel*, *np.diagonal* and *np.diag* now preserve subtypes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There was inconsistent behavior between *x.ravel()* and *np.ravel(x)*, as
well as between *x.diagonal()* and *np.diagonal(x)*, with the methods
preserving subtypes while the functions did not. This has been fixed and
the functions now behave like the methods, preserving subtypes except in
the case of matrices. Matrices are special cased for backward
compatibility and still return 1-D arrays as before. If you need to
preserve the matrix subtype, use the methods instead of the functions.
*rollaxis* and *swapaxes* always return a view
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Previously, a view was returned except when no change was made in the order
of the axes, in which case the input array was returned. A view is now
returned in all cases.
C API
~~~~~
The changes to *swapaxes* also apply to the *PyArray_SwapAxes* C function,
which now returns a view in all cases.
recarray field return types
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Previously the returned types for recarray fields accessed by attribute and by
index were inconsistent, and fields of string type were returned as chararrays.
Now, fields accessed by either attribute or indexing will return an ndarray for
fields of non-structured type, and a recarray for fields of structured type.
Notably, this affect recarrays containing strings with whitespace, as trailing
whitespace is trimmed from chararrays but kept in ndarrays of string type.
Also, the dtype.type of nested structured fields is now inherited.
New Features
============
*np.cbrt* to compute cube root for real floats
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*np.cbrt* wraps the C99 cube root function *cbrt*.
Compared to *np.power(x, 1./3.)* it is well defined for negative real floats
and a bit faster.
numpy.distutils now allows parallel compilation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By passing *--jobs=n* or *-j n* to *setup.py build* the compilation of
extensions is now performed in *n* parallel processes.
The parallelization is limited to files within one extension so projects using
Cython will not profit because it builds extensions from single files.
*genfromtxt* has an new ``max_rows`` argument
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A ``max_rows`` argument has been added to *genfromtxt* to limit the
number of rows read in a single call. Using this functionality, it is
possible to read in multiple arrays stored in a single file by making
repeated calls to the function.
Improvements
============
*np.digitize* using binary search
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*np.digitize* is now implemented in terms of *np.searchsorted*. This means
that a binary search is used to bin the values, which scales much better
for larger number of bins than the previous linear search. It also removes
the requirement for the input array to be 1-dimensional.
*np.poly* now casts integer inputs to float
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*np.poly* will now cast 1-dimensional input arrays of integer type to double
precision floating point, to prevent integer overflow when computing the monic
polynomial. It is still possible to obtain higher precision results by
passing in an array of object type, filled e.g. with Python ints.
*np.interp* can now be used with periodic functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*np.interp* now has a new parameter *period* that supplies the period of the
input data *xp*. In such case, the input data is properly normalized to the
given period and one end point is added to each extremity of *xp* in order to
close the previous and the next period cycles, resulting in the correct
interpolation behavior.
*np.pad* supports more input types for ``pad_width`` and ``constant_values``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``constant_values`` parameters now accepts NumPy arrays and float values.
NumPy arrays are supported as input for ``pad_width``, and an exception is
raised if its values are not of integral type.
More system C99 complex functions detected and used
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All of the functions ``in complex.h`` are now detected. There are new
fallback implementations of the following functions.
* npy_ctan,
* npy_cacos, npy_casin, npy_catan
* npy_ccosh, npy_csinh, npy_ctanh,
* npy_cacosh, npy_casinh, npy_catanh
As a result of these improvements, there will be some small changes in
returned values, especially for corner cases.
*np.loadtxt* support for the strings produced by the ``float.hex`` method
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The strings produced by ``float.hex`` look like ``0x1.921fb54442d18p+1``,
so this is not the hex used to represent unsigned integer types.
*np.isclose* properly handles minimal values of integer dtypes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In order to properly handle minimal values of integer types, *np.isclose* will
now cast to the float dtype during comparisons. This aligns its behavior with
what was provided by *np.allclose*.
*np.allclose* uses *np.isclose* internally.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*np.allcose* now uses *np.isclose* internally and inherits the ability to
compare NaNs as equal by setting ``equal_nan=True``. Subclasses, such as
*np.ma.MaskedArray*, are also preserved now.
Changes
=======
dotblas functionality moved to multiarray
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The cblas versions of dot, inner, and vdot have been integrated into
the multiarray module. In particular, vdot is now a multiarray function,
which it was not before.
stricter check of gufunc signature compliance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Inputs to generalized universal functions are now more strictly checked
against the function's signature: all core dimensions are now required to
be present in input arrays; core dimensions with the same label must have
the exact same size; and output core dimension's must be specified, either
by a same label input core dimension or by a passed-in output array.
views returned from *np.einsum* are writeable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Views returned by *np.einsum* will now be writeable whenever the input
array is writeable.
Deprecations
============
SafeEval
~~~~~~~~
The SafeEval class in numpy/lib/utils.py is deprecated and will be removed
in the next release.
alterdot, restoredot
~~~~~~~~~~~~~~~~~~~~
The alterdot and restoredot functions no longer do anything, and are
deprecated.
pkgload, PackageLoader
~~~~~~~~~~~~~~~~~~~~~~
These ways of loading packages are now deprecated.
|