This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==1.15.1
->==1.16.2
By merging this PR, the below issues will be automatically resolved and closed:
Release Notes
numpy/numpy
v1.16.2
Compare Source
========================== NumPy 1.16.2 Release Notes
NumPy 1.16.2 is a quick release fixing several problems encountered on Windows.
The Python versions supported are 2.7 and 3.5-3.7. The Windows problems
addressed are:
There is also a regression fix correcting signed zeros produced by divmod, see
below for details.
Downstream developers building this release should use Cython >= 0.29.2 and, if
using OpenBLAS, OpenBLAS > v0.3.4.
If you are installing using pip, you may encounter a problem with older
installed versions of NumPy that pip did not delete becoming mixed with the
current version, resulting in an
ImportError
. That problem is particularlycommon on Debian derived distributions due to a modified pip. The fix is to
make sure all previous NumPy versions installed by pip have been removed. See
#​12736 <https://github.com/numpy/numpy/issues/12736>
__ for discussion of theissue.
Compatibility notes
Signed zero when using divmod
Starting in version 1.12.0, numpy incorrectly returned a negatively signed zero
when using the
divmod
andfloor_divide
functions when the result waszero. For example:
With this release, the result is correctly returned as a positively signed
zero:
Contributors
A total of 5 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
Pull requests merged
A total of 7 pull requests were merged for this release.
Checksums
MD5
SHA256
v1.16.1
Compare Source
========================== NumPy 1.16.1 Release Notes
The NumPy 1.16.1 release fixes bugs reported against the 1.16.0 release, and
also backports several enhancements from master that seem appropriate for a
release series that is the last to support Python 2.7. The wheels on PyPI are
linked with OpenBLAS v0.3.4+, which should fix the known threading issues
found in previous OpenBLAS versions.
Downstream developers building this release should use Cython >= 0.29.2 and, if
using OpenBLAS, OpenBLAS > v0.3.4.
If you are installing using pip, you may encounter a problem with older
installed versions of NumPy that pip did not delete becoming mixed with the
current version, resulting in an
ImportError
. That problem is particularlycommon on Debian derived distributions due to a modified pip. The fix is to
make sure all previous NumPy versions installed by pip have been removed. See
#​12736 <https://github.com/numpy/numpy/issues/12736>
__ for discussion of theissue. Note that previously this problem resulted in an
AttributeError
.Contributors
A total of 16 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
Enhancements
np.ctypeslib.as_ctypes
Compatibility notes
The changed error message emited by array comparison testing functions may
affect doctests. See below for detail.
Casting from double and single denormals to float16 has been corrected. In
some rare cases, this may result in results being rounded up instead of down,
changing the last bit (ULP) of the result.
New Features
divmod operation is now supported for two
timedelta64
operandsThe divmod operator now handles two
np.timedelta64
operands, withtype signature
mm->qm
.Improvements
Further improvements to
ctypes
support innp.ctypeslib
A new
np.ctypeslib.as_ctypes_type
function has been added, which can beused to converts a
dtype
into a best-guessctypes
type. Thanks to thisnew function,
np.ctypeslib.as_ctypes
now supports a much wider range ofarray types, including structures, booleans, and integers of non-native
endianness.
Array comparison assertions include maximum differences
Error messages from array comparison tests such as
np.testing.assert_allclose
now include "max absolute difference" and"max relative difference," in addition to the previous "mismatch" percentage.
This information makes it easier to update absolute and relative error
tolerances.
Changes
timedelta64 % 0
behavior adjusted to returnNaT
The modulus operation with two
np.timedelta64
operands now returnsNaT
in the case of division by zero, rather than returning zeroChecksums
MD5
SHA256
v1.16.0
Compare Source
========================== NumPy 1.16.0 Release Notes
This NumPy release is the last one to support Python 2.7 and will be maintained
as a long term release with bug fixes until 2020. Support for Python 3.4 been
dropped, the supported Python versions are 2.7 and 3.5-3.7. The wheels on PyPI
are linked with OpenBLAS v0.3.4+, which should fix the known threading issues
found in previous OpenBLAS versions.
Downstream developers building this release should use Cython >= 0.29 and, if
using OpenBLAS, OpenBLAS > v0.3.4.
This release has seen a lot of refactoring and features many bug fixes, improved
code organization, and better cross platform compatibility. Not all of these
improvements will be visible to users, but they should help make maintenance
easier going forward.
Highlights
Experimental support for overriding numpy functions,
see
__array_function__
below.The
matmul
function is now a ufunc. This provides betterperformance and allows overriding with
__array_ufunc__
.Improved support for the ARM and POWER architectures.
Improved support for AIX and PyPy.
Improved interop with ctypes.
Improved support for PEP 3118.
New functions
New functions added to the
numpy.lib.recfuntions
module to ease thestructured assignment changes:
assign_fields_by_name
structured_to_unstructured
unstructured_to_structured
apply_along_fields
require_fields
See the user guide at https://docs.scipy.org/doc/numpy/user/basics.rec.html
for more info.
New deprecations
The type dictionaries
numpy.core.typeNA
andnumpy.core.sctypeNA
aredeprecated. They were buggy and not documented and will be removed in the
1.18 release. Use
numpy.sctypeDict
instead.The
numpy.asscalar
function is deprecated. It is an alias to the morepowerful
numpy.ndarray.item
, not tested, and fails for scalars.The
numpy.set_array_ops
andnumpy.get_array_ops
functions are deprecated.As part of
NEP 15
, they have been deprecated along with the C-API functions:c:func:
PyArray_SetNumericOps
and :c:func:PyArray_GetNumericOps
. Userswho wish to override the inner loop functions in built-in ufuncs should use
:c:func:
PyUFunc_ReplaceLoopBySignature
.The
numpy.unravel_index
keyword argumentdims
is deprecated, useshape
instead.The
numpy.histogram
normed
argument is deprecated. It was deprecatedpreviously, but no warning was issued.
The
positive
operator (+
) applied to non-numerical arrays isdeprecated. See below for details.
Passing an iterator to the stack functions is deprecated
Expired deprecations
NaT comparisons now return
False
without a warning, finishing adeprecation cycle begun in NumPy 1.11.
np.lib.function_base.unique
was removed, finishing a deprecation cyclebegun in NumPy 1.4. Use
numpy.unique
instead.multi-field indexing now returns views instead of copies, finishing a
deprecation cycle begun in NumPy 1.7. The change was previously attempted in
NumPy 1.14 but reverted until now.
np.PackageLoader
andnp.pkgload
have been removed. These weredeprecated in 1.10, had no tests, and seem to no longer work in 1.15.
Future changes
Compatibility notes
f2py script on Windows
On Windows, the installed script for running f2py is now an
.exe
filerather than a
*.py
file and should be run from the command line asf2py
whenever the
Scripts
directory is in the path. Runningf2py
as a modulepython -m numpy.f2py [...]
will work without path modification in anyversion of NumPy.
NaT comparisons
Consistent with the behavior of NaN, all comparisons other than inequality
checks with datetime64 or timedelta64 NaT ("not-a-time") values now always
return
False
, and inequality checks with NaT now always returnTrue
.This includes comparisons beteween NaT values. For compatibility with the
old behavior, use
np.isnat
to explicitly check for NaT or convertdatetime64/timedelta64 arrays with
.astype(np.int64)
before makingcomparisons.
complex64/128 alignment has changed
The memory alignment of complex types is now the same as a C-struct composed of
two floating point values, while before it was equal to the size of the type.
For many users (for instance on x64/unix/gcc) this means that complex64 is now
4-byte aligned instead of 8-byte aligned. An important consequence is that
aligned structured dtypes may now have a different size. For instance,
np.dtype('c8,u1', align=True)
used to have an itemsize of 16 (on x64/gcc)but now it is 12.
More in detail, the complex64 type now has the same alignment as a C-struct
struct {float r, i;}
, according to the compiler used to compile numpy, andsimilarly for the complex128 and complex256 types.
nd_grid len removal
len(np.mgrid)
andlen(np.ogrid)
are now considered nonsensicaland raise a
TypeError
.np.unravel_index
now acceptsshape
keyword argumentPreviously, only the
dims
keyword argument was acceptedfor specification of the shape of the array to be used
for unraveling.
dims
remains supported, but is now deprecated.multi-field views return a view instead of a copy
Indexing a structured array with multiple fields, e.g.,
arr[['f1', 'f3']]
,returns a view into the original array instead of a copy. The returned view
will often have extra padding bytes corresponding to intervening fields in the
original array, unlike before, which will affect code such as
arr[['f1', 'f3']].view('float64')
. This change has been planned since numpy1.7. Operations hitting this path have emitted
FutureWarnings
since then.Additional
FutureWarnings
about this change were added in 1.12.To help users update their code to account for these changes, a number of
functions have been added to the
numpy.lib.recfunctions
module whichsafely allow such operations. For instance, the code above can be replaced
with
structured_to_unstructured(arr[['f1', 'f3']], dtype='float64')
.See the "accessing multiple fields" section of the
user guide <https://docs.scipy.org/doc/numpy/user/basics.rec.html#accessing-multiple-fields>
__.C API changes
The :c:data:
NPY_API_VERSION
was incremented to 0x0000D, due to the additionof:
PyUFuncObject.core_dim_flags
PyUFuncObject.core_dim_sizes
PyUFuncObject.identity_value
PyUFunc_FromFuncAndDataAndSignatureAndIdentity
New Features
Integrated squared error (ISE) estimator added to
histogram
This method (
bins='stone'
) for optimizing the bin number is ageneralization of the Scott's rule. The Scott's rule assumes the distribution
is approximately Normal, while the ISE_ is a non-parametric method based on
cross-validation.
.. _ISE: https://en.wikipedia.org/wiki/Histogram#Minimizing_cross-validation_estimated_squared_error
max_rows
keyword added fornp.loadtxt
New keyword
max_rows
innumpy.loadtxt
sets the maximum rows of thecontent to be read after
skiprows
, as innumpy.genfromtxt
.modulus operator support added for
np.timedelta64
operandsThe modulus (remainder) operator is now supported for two operands
of type
np.timedelta64
. The operands may have different unitsand the return value will match the type of the operands.
Improvements
no-copy pickling of numpy arrays
Up to protocol 4, numpy array pickling created 2 spurious copies of the data
being serialized. With pickle protocol 5, and the
PickleBuffer
API, alarge variety of numpy arrays can now be serialized without any copy using
out-of-band buffers, and with one less copy using in-band buffers. This
results, for large arrays, in an up to 66% drop in peak memory usage.
build shell independence
NumPy builds should no longer interact with the host machine
shell directly.
exec_command
has been replaced withsubprocess.check_output
where appropriate.np.polynomial.Polynomial
classes render in LaTeX in Jupyter notebooksWhen used in a front-end that supports it,
Polynomial
instances are nowrendered through LaTeX. The current format is experimental, and is subject to
change.
randint
andchoice
now work on empty distributionsEven when no elements needed to be drawn,
np.random.randint
andnp.random.choice
raised an error when the arguments described an emptydistribution. This has been fixed so that e.g.
np.random.choice([], 0) == np.array([], dtype=float64)
.linalg.lstsq
,linalg.qr
, andlinalg.svd
now work with empty arraysPreviously, a
LinAlgError
would be raised when an empty matrix/emptymatrices (with zero rows and/or columns) is/are passed in. Now outputs of
appropriate shapes are returned.
Chain exceptions to give better error messages for invalid PEP3118 format strings
This should help track down problems.
Einsum optimization path updates and efficiency improvements
Einsum was synchronized with the current upstream work.
numpy.angle
andnumpy.expand_dims
now work onndarray
subclassesIn particular, they now work for masked arrays.
NPY_NO_DEPRECATED_API
compiler warning suppressionSetting
NPY_NO_DEPRECATED_API
to a value of 0 will suppress the current compilerwarnings when the deprecated numpy API is used.
np.diff
Added kwargs prepend and appendNew kwargs
prepend
andappend
, allow for values to be inserted oneither end of the differences. Similar to options for
ediff1d
. Now theinverse of
cumsum
can be obtained easily viaprepend=0
.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. CI testing has been expanded to include AARCH64 targets
via the services of shippable.com.
Appending to build flags
numpy.distutils
has always overridden rather than appended toLDFLAGS
andother similar such environment variables for compiling Fortran extensions.
Now, if the
NPY_DISTUTILS_APPEND_FLAGS
environment variable is set to 1, thebehavior will be appending. This applied to:
LDFLAGS
,F77FLAGS
,F90FLAGS
,FREEFLAGS
,FOPT
,FDEBUG
, andFFLAGS
. See gh-11525 for moredetails.
Generalized ufunc signatures now allow fixed-size dimensions
By using a numerical value in the signature of a generalized ufunc, one can
indicate that the given function requires input or output to have dimensions
with the given size. E.g., the signature of a function that converts a polar
angle to a two-dimensional cartesian unit vector would be
()->(2)
; thatfor one that converts two spherical angles to a three-dimensional unit vector
would be
(),()->(3)
; and that for the cross product of twothree-dimensional vectors would be
(3),(3)->(3)
.Note that to the elementary function these dimensions are not treated any
differently from variable ones indicated with a name starting with a letter;
the loop still is passed the corresponding size, but it can now count on that
size being equal to the fixed one given in the signature.
Generalized ufunc signatures now allow flexible dimensions
Some functions, in particular numpy's implementation of
@
asmatmul
,are very similar to generalized ufuncs in that they operate over core
dimensions, but one could not present them as such because they were able to
deal with inputs in which a dimension is missing. To support this, it is now
allowed to postfix a dimension name with a question mark to indicate that the
dimension does not necessarily have to be present.
With this addition, the signature for
matmul
can be expressed as(m?,n),(n,p?)->(m?,p?)
. This indicates that if, e.g., the second operandhas only one dimension, for the purposes of the elementary function it will be
treated as if that input has core shape
(n, 1)
, and the output has thecorresponding core shape of
(m, 1)
. The actual output array, however, hasthe flexible dimension removed, i.e., it will have shape
(..., m)
.Similarly, if both arguments have only a single dimension, the inputs will be
presented as having shapes
(1, n)
and(n, 1)
to the elementaryfunction, and the output as
(1, 1)
, while the actual output array returnedwill have shape
()
. In this way, the signature allows one to use asingle elementary function for four related but different signatures,
(m,n),(n,p)->(m,p)
,(n),(n,p)->(p)
,(m,n),(n)->(m)
and(n),(n)->()
.np.clip
and theclip
method check for memory overlapThe
out
argument to these functions is now always tested for memory overlapto avoid corrupted results when memory overlap occurs.
New value
unscaled
for optioncov
innp.polyfit
A further possible value has been added to the
cov
parameter of thenp.polyfit
function. Withcov='unscaled'
the scaling of the covariancematrix is disabled completely (similar to setting
absolute_sigma=True
inscipy.optimize.curve_fit
). This would be useful in occasions, where theweights are given by 1/sigma with sigma being the (known) standard errors of
(Gaussian distributed) data points, in which case the unscaled matrix is
already a correct estimate for the covariance matrix.
Detailed docstrings for scalar numeric types
The
help
function, when applied to numeric types such asnumpy.intc
,numpy.int_
, andnumpy.longlong
, now lists all of the aliased names for thattype, distinguishing between platform -dependent and -independent aliases.
__module__
attribute now points to public modulesThe
__module__
attribute on most NumPy functions has been updated to referto the preferred public module from which to access a function, rather than
the module in which the function happens to be defined. This produces more
informative displays for functions in tools such as IPython, e.g., instead of
<function 'numpy.core.fromnumeric.sum'>
you now see<function 'numpy.sum'>
.Large allocations marked as suitable for transparent hugepages
On systems that support transparent hugepages over the madvise system call
numpy now marks that large memory allocations can be backed by hugepages which
reduces page fault overhead and can in some fault heavy cases improve
performance significantly. On Linux the setting for huge pages to be used,
/sys/kernel/mm/transparent_hugepage/enabled
, must be at leastmadvise
.Systems which already have it set to
always
will not see much difference asthe kernel will automatically use huge pages where appropriate.
Users of very old Linux kernels (~3.x and older) should make sure that
/sys/kernel/mm/transparent_hugepage/defrag
is not set toalways
to avoidperformance problems due concurrency issues in the memory defragmentation.
Alpine Linux (and other musl c library distros) support
We now default to use
fenv.h
for floating point status error reporting.Previously we had a broken default that sometimes would not report underflow,
overflow, and invalid floating point operations. Now we can support non-glibc
distrubutions like Alpine Linux as long as they ship
fenv.h
.Speedup
np.block
for large arraysLarge arrays (greater than
512 * 512
) now use a blocking algorithm based oncopying the data directly into the appropriate slice of the resulting array.
This results in significant speedups for these large arrays, particularly for
arrays being blocked along more than 2 dimensions.
arr.ctypes.data_as(...)
holds a reference to arrv1.15.4
Compare Source
========================== NumPy 1.15.4 Release Notes
This is a bugfix release for bugs and regressions reported following the 1.15.3
release. 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 relateddiscussion. 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.
bbbbbbb
+Pull requests merged
A total of 4 pull requests were merged for this release.
optimize
innumpy.einsum
Checksums
MD5
SHA256
v1.15.3
Compare Source
========================== NumPy 1.15.3 Release Notes
This is a bugfix release for bugs and regressions reported following the 1.15.2
release. 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 relateddiscussion. Those needing 32-bit support should look elsewhere or build
from source.
Contributors
A total of 7 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
Pull requests merged
A total of 12 pull requests were merged for this release.
Checksums
MD5