summaryrefslogtreecommitdiff
path: root/doc/release/1.16.0-notes.rst
blob: 4a38af7776211e351c6d71e7ff8db688966661fe (plain)
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
==========================
NumPy 1.16.0 Release Notes
==========================

This NumPy release is the last one to support Python 2.7. It will be maintained
as a long term release with bug fixes only through 2020. To that end, the
planned code reorganization detailed in NEP-0015 has been made in order to
facilitate backporting fixes from future releases, which will now have the
same code organization.

Support for Python 3.4 been dropped in this release, the supported Python
versions are 2.7 and 3.5-3.7. The wheels are linked with OpenBLAS v0.3.0 .


Highlights
==========


New functions
=============


Deprecations
============

`typeNA` and `sctypeNA` have been deprecated
--------------------------------------------

The type dictionaries `numpy.core.typeNA` and `numpy.core.sctypeNA` were buggy
and not documented. They will be removed in the 1.18 release. Use
`numpy.sctypeDict` instead.


``np.PackageLoader`` and ``np.pkgload`` have been removed
---------------------------------------------------------
These were deprecated in 1.10, had no tests, and seem to no longer work in
1.15 anyway.


Future Changes
==============

* NumPy 1.17 will drop support for Python 2.7.


Compatibility notes
===================

f2py script on Windows
----------------------
On Windows, the installed script for running f2py is now an ``.exe`` file
rather than a ``*.py`` file and should be run from the command line as ``f2py``
whenever the ``Scripts`` directory is in the path. Folks needing compatibility
with earler versions of Numpy should run ``f2py`` as a module: ``python -m
numpy.f2py [...]``.


C API changes
=============


New Features
============


Improvements
============

`np.polynomial.Polynomial` classes render in LaTeX in Jupyter notebooks
-----------------------------------------------------------------------

When used in a front-end that supports it, `Polynomial` instances are now
rendered through LaTeX. The current format is experimental, and is subject to
change.

``randint`` and ``choice`` now work on empty distributions
----------------------------------------------------------
Even when no elements needed to be drawn, ``np.random.randint`` and
``np.random.choice`` raised an error when the arguments described an empty
distribution. This has been fixed so that e.g.
``np.random.choice([], 0) == np.array([], dtype=float64)``.

``linalg.lstsq`` and ``linalg.qr`` now work with empty matrices
---------------------------------------------------------------
Previously, a ``LinAlgError`` would be raised when an empty matrix/empty
matrices (with zero rows and/or columns) is/are passed in. Now outputs of
appropriate shapes are returned.

ARM support updated
-------------------
Support for ARM CPUs has been updated to accommodate 32 and 64 bit targets,
and also big and little endian byte ordering. AARCH32 memory alignment issues
have been addressed.

Appending to build flags
------------------------
`numpy.distutils` has always overridden rather than appended to `LDFLAGS` and
other similar such environment variables for compiling Fortran extensions.
Now, if the `NPY_DISTUTILS_APPEND_FLAGS` environment variable is set to 1, the
behavior will be appending.  This applied to: `LDFLAGS`, `F77FLAGS`,
`F90FLAGS`, `FREEFLAGS`, `FOPT`, `FDEBUG`, and `FFLAGS`.  See gh-11525 for more
details.

``np.clip`` and the ``clip`` method check for memory overlap
------------------------------------------------------------
The ``out`` argument to these functions is now always tested for memory overlap
to avoid corrupted results when memory overlap occurs.


Changes
=======

Comparison ufuncs will now error rather than return NotImplemented
------------------------------------------------------------------
Previously, comparison ufuncs such as ``np.equal`` would return
`NotImplemented` if their arguments had structured dtypes, to help comparison
operators such as ``__eq__`` deal with those.  This is no longer needed, as the
relevant logic has moved to the comparison operators proper (which thus do
continue to return `NotImplemented` as needed). Hence, like all other ufuncs,
the comparison ufuncs will now error on structured dtypes.

Positive will now raise a deprecation warning for non-numerical arrays
----------------------------------------------------------------------
Previously, ``+array`` unconditionally returned a copy. Now, it will
raise a ``DeprecationWarning`` if the array is not numerical (i.e.,
if ``np.positive(array)`` raises a ``TypeError``. For ``ndarray``
subclasses that override the default ``__array_ufunc__`` implementation,
the ``TypeError`` is passed on.

``maximum`` and ``minimum`` set invalid float status for more dtypes
--------------------------------------------------------------------
Previously only ``float32`` and ``float64`` set invalid float status (by
default emitting a `RuntimeWarning`) when a Nan is encountered in
`numpy.maximum` and `numpy.minimum`. Now ``float16``, ``complex64``,
``complex128`` and ``complex256`` will do so as well.

Umath and multiarray c-extension modules merged into a single module
--------------------------------------------------------------------
The two modules were merged, according to the first step in `NEP 15`_.
Previously `np.core.umath` and `np.core.multiarray` were the c-extension
modules, they are now python wrappers to the single `np.core/_multiarray_math`
c-extension module.

.. _`NEP 15` : http://www.numpy.org/neps/nep-0015-merge-multiarray-umath.html