Update dependency numpy to v1.21.2 #27
Open
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.19.1->==1.21.2Release Notes
numpy/numpy
v1.21.2Compare Source
NumPy 1.21.2 Release Notes
The NumPy 1.21.2 is maintenance release that fixes bugs discovered after
1.21.1. It also provides 64 bit manylinux Python 3.10.0rc1 wheels for
downstream testing. Note that Python 3.10 is not yet final. There is
also preliminary support for Windows on ARM64 builds, but there is no
OpenBLAS for that platform and no wheels are available.
The Python versions supported for this release are 3.7-3.9. The 1.21.x
series is compatible with Python 3.10.0rc1 and Python 3.10 will be
officially supported after it is released. The previous problems with
gcc-11.1 have been fixed by gcc-11.2, check your version if you are
using gcc-11.
Contributors
A total of 10 people contributed to this release. People with a "+" by
their names contributed a patch for the first time.
Pull requests merged
A total of 18 pull requests were merged for this release.
<3.11numpy.typingcould raise-Werrorisn't applicable...runtest.pyChecksums
MD5
SHA256
v1.21.1Compare Source
NumPy 1.21.1 Release Notes
The NumPy 1.21.1 is maintenance release that fixes bugs discovered after
the 1.21.0 release and updates OpenBLAS to v0.3.17 to deal with problems
on arm64.
The Python versions supported for this release are 3.7-3.9. The 1.21.x
series is compatible with development Python 3.10. Python 3.10 will be
officially supported after it is released.
warnings when running the tests.
Contributors
A total of 11 people contributed to this release. People with a "+" by
their names contributed a patch for the first time.
Pull requests merged
A total of 26 pull requests were merged for this release.
NotImplementedwithtyping.Anyndarray.realandimag"dtype[Any]"withdtypein the definiton of...numpy.f2py.get_includefunctionnp.numbersubclassesprint()'s in distutils template handlingGenericAliastest failure for python 3.9.0Checksums
MD5
SHA256
v1.21.0Compare Source
NumPy 1.21.0 Release Notes
The NumPy 1.21.0 release highlights are
PCG64DXSMbitgenerator for random numbers.In addition there are the usual large number of bug fixes and other
improvements.
The Python versions supported for this release are 3.7-3.9. Official
support for Python 3.10 will be added when it is released.
-O3results in many wrong warnings when running the tests.New functions
Add PCG64DXSM BitGenerator
Uses of the PCG64 BitGenerator in a massively-parallel context have
been shown to have statistical weaknesses that were not apparent at the
first release in numpy 1.17. Most users will never observe this weakness
and are safe to continue to use PCG64. We have introduced a new
PCG64DXSM BitGenerator that will eventually become the new default
BitGenerator implementation used by
default_rngin future releases.PCG64DXSM solves the statistical weakness while preserving the
performance and the features of PCG64.
See
upgrading-pcg64for more details.(gh-18906)
Expired deprecations
The
shapeargumentnumpy.unravel_indexcannot bepassed as
dimskeyword argument anymore. (Was deprecated in NumPy1.16.)
(gh-17900)
The function
PyUFunc_GenericFunctionhas been disabled. It wasdeprecated in NumPy 1.19. Users should call the ufunc directly using
the Python API.
(gh-18697)
The function
PyUFunc_SetUsesArraysAsDatahas been disabled. It wasdeprecated in NumPy 1.19.
(gh-18697)
The class
PolyBasehas been removed (deprecated in numpy 1.9.0).Please use the abstract
ABCPolyBaseclass instead.(gh-18963)
The unused
PolyErrorandPolyDomainErrorexceptions are removed.(gh-18963)
Deprecations
The
.dtypeattribute must return adtypeA
DeprecationWarningis now given if the.dtypeattribute of anobject passed into
np.dtypeor as adtype=objargument is not adtype. NumPy will stop attempting to recursively coerce the result of
.dtype.(gh-13578)
Inexact matches for
numpy.convolveandnumpy.correlateare deprecatednumpy.convolveandnumpy.correlatenowemit a warning when there are case insensitive and/or inexact matches
found for
modeargument in the functions. Pass full"same","valid","full"strings instead of"s","v","f"for themodeargument.(gh-17492)
np.typeDicthas been formally deprecatednp.typeDictis a deprecated alias fornp.sctypeDictand has been sofor over 14 years
(6689502).
A deprecation warning will now be issued whenever getting
np.typeDict.(gh-17586)
Exceptions will be raised during array-like creation
When an object raised an exception during access of the special
attributes
__array__or__array_interface__, this exception wasusually ignored. A warning is now given when the exception is anything
but AttributeError. To silence the warning, the type raising the
exception has to be adapted to raise an
AttributeError.(gh-19001)
Four
ndarray.ctypesmethods have been deprecatedFour methods of the
ndarray.ctypesobject have beendeprecated, as they are (undocumentated) implementation artifacts of
their respective properties.
The methods in question are:
_ctypes.get_data(use_ctypes.datainstead)_ctypes.get_shape(use_ctypes.shapeinstead)_ctypes.get_strides(use_ctypes.stridesinstead)_ctypes.get_as_parameter(use_ctypes._as_parameter_instead)(gh-19031)
Expired deprecations
The
shapeargumentnumpy.unravel_index] cannot bepassed as
dimskeyword argument anymore. (Was deprecated in NumPy1.16.)
(gh-17900)
The function
PyUFunc_GenericFunctionhas been disabled. It wasdeprecated in NumPy 1.19. Users should call the ufunc directly using
the Python API.
(gh-18697)
The function
PyUFunc_SetUsesArraysAsDatahas been disabled. It wasdeprecated in NumPy 1.19.
(gh-18697)
Remove deprecated
PolyBaseand unusedPolyErrorandPolyDomainErrorThe class
PolyBasehas been removed (deprecated in numpy 1.9.0).Please use the abstract
ABCPolyBaseclass instead.Furthermore, the unused
PolyErrorandPolyDomainErrorexceptions areremoved from the
numpy.polynomial.(gh-18963)
Compatibility notes
Error type changes in universal functions
The universal functions may now raise different errors on invalid input
in some cases. The main changes should be that a
RuntimeErrorwasreplaced with a more fitting
TypeError. When multiple errors werepresent in the same call, NumPy may now raise a different one.
(gh-15271)
__array_ufunc__argument validationNumPy will now partially validate arguments before calling
__array_ufunc__. Previously, it was possible to pass on invalidarguments (such as a non-existing keyword argument) when dispatch was
known to occur.
(gh-15271)
__array_ufunc__and additional positional argumentsPreviously, all positionally passed arguments were checked for
__array_ufunc__support. In the case ofreduce,accumulate, andreduceatall arguments may be passed by position. This means that whenthey were passed by position, they could previously have been asked to
handle the ufunc call via
__array_ufunc__. Since this depended on theway the arguments were passed (by position or by keyword), NumPy will
now only dispatch on the input and output array. For example, NumPy will
never dispatch on the
wherearray in a reduction such asnp.add.reduce.(gh-15271)
Validate input values in
Generator.uniformChecked that
high - low >= 0innp.random.Generator.uniform. RaisesValueErroriflow > high. Previously out-of-order inputs wereaccepted and silently swapped, so that if
low > high, the valuegenerated was
high + (low - high) * random().(gh-17921)
/usr/includeremoved from default include pathsThe default include paths when building a package with
numpy.distutilsno longer include
/usr/include. This path is normally added by thecompiler, and hardcoding it can be problematic. In case this causes a
problem, please open an issue. A workaround is documented in PR 18658.
(gh-18658)
Changes to comparisons with
dtype=...When the
dtype=(orsignature) arguments to comparison ufuncs(
equal,less, etc.) is used, this will denote the desired outputdtype in the future. This means that:
will give a
FutureWarningthat it will return anobjectarray in thefuture, which currently happens for:
due to the fact that
np.array(None)is already an object array. (Thisalso happens for some other dtypes.)
Since comparisons normally only return boolean arrays, providing any
other dtype will always raise an error in the future and give a
DeprecationWarningnow.(gh-18718)
Changes to
dtypeandsignaturearguments in ufuncsThe universal function arguments
dtypeandsignaturewhich are alsovalid for reduction such as
np.add.reduce(which is the implementationfor
np.sum) will now issue a warning when thedtypeprovided is nota "basic" dtype.
NumPy almost always ignored metadata, byteorder or time units on these
inputs. NumPy will now always ignore it and raise an error if byteorder
or time unit changed. The following are the most important examples of
changes which will give the error. In some cases previously the
information stored was not ignored, in all of these an error is now
raised:
Previously ignored the byte-order (affect if non-native)
The biggest impact is for timedelta or datetimes:
The examples always ignored the time unit "ns":
The following previously did use "ns" (as opposed to
arr.dtype)The same applies for functions like
np.sumwhich use these internally.This change is necessary to achieve consistent handling within NumPy.
If you run into these, in most cases pass for example
dtype=np.timedelta64which clearly denotes a generaltimedelta64without any unit or byte-order defined. If you need to specify the
output dtype precisely, you may do so by either casting the inputs or
providing an output array using
out=.NumPy may choose to allow providing an exact output
dtypehere in thefuture, which would be preceded by a
FutureWarning.(gh-18718)
Ufunc
signature=...anddtype=generalization andcastingThe behaviour for
np.ufunc(1.0, 1.0, signature=...)ornp.ufunc(1.0, 1.0, dtype=...)can now yield different loops in 1.21compared to 1.20 because of changes in promotion. When
signaturewaspreviously used, the casting check on inputs was relaxed, which could
lead to downcasting inputs unsafely especially if combined with
casting="unsafe".Casting is now guaranteed to be safe. If a signature is only partially
provided, for example using
signature=("float64", None, None), thiscould lead to no loop being found (an error). In that case, it is
necessary to provide the complete signature to enforce casting the
inputs. If
dtype="float64"is used or only outputs are set (e.g.signature=(None, None, "float64")the is unchanged. We expect thatvery few users are affected by this change.
Further, the meaning of
dtype="float64"has been slightly modified andnow strictly enforces only the correct output (and not input) DTypes.
This means it is now always equivalent to:
(If the ufunc has two inputs and one output). Since this could lead to
no loop being found in some cases, NumPy will normally also search for
the loop:
if the first search failed. In the future, this behaviour may be
customized to achieve the expected results for more complex ufuncs. (For
some universal functions such as
np.ldexpinputs can have differentDTypes.)
(gh-18880)
Distutils forces strict floating point model on clang
NumPy distutils will now always add the
-ffp-exception-behavior=strictcompiler flag when compiling with clang. Clang defaults to a non-strict
version, which allows the compiler to generate code that does not set
floating point warnings/errors correctly.
(gh-19049)
C API changes
Use of
ufunc->type_resolverand "type tuple"NumPy now normalizes the "type tuple" argument to the type resolver
functions before calling it. Note that in the use of this type resolver
is legacy behaviour and NumPy will not do so when possible. Calling
ufunc->type_resolverorPyUFunc_DefaultTypeResolveris stronglydiscouraged and will now enforce a normalized type tuple if done. Note
that this does not affect providing a type resolver, which is expected
to keep working in most circumstances. If you have an unexpected
use-case for calling the type resolver, please inform the NumPy
developers so that a solution can be found.
(gh-18718)
New Features
Added a mypy plugin for handling platform-specific
numpy.numberprecisionsA mypy plugin is now available for
automatically assigning the (platform-dependent) precisions of certain
numpy.numbersubclasses, including the likes ofnumpy.int_,numpy.intpandnumpy.longlong. See the documentation onscalar types <arrays.scalars.built-in>for a comprehensive overview of the affected classes.
Note that while usage of the plugin is completely optional, without it
the precision of above-mentioned classes will be inferred as
typing.Any.To enable the plugin, one must add it to their mypy [configuration file]
(https://mypy.readthedocs.io/en/stable/config_file.html):
(gh-17843)
Let the mypy plugin manage extended-precision
numpy.numbersubclassesThe mypy plugin, introduced in
numpy/numpy#17843, has
been expanded: the plugin now removes annotations for platform-specific
extended-precision types that are not available to the platform in
question. For example, it will remove
numpy.float128when not available.
Without the plugin all extended-precision types will, as far as mypy
is concerned, be available on all platforms.
To enable the plugin, one must add it to their mypy configuration
file:
(gh-18322)
New
min_digitsargument for printing float valuesA new
min_digitsargument has been added to the dragon4 float printingfunctions
numpy.format_float_positionalandnumpy.format_float_scientific. This kwd guaranteesthat at least the given number of digits will be printed when printing
in unique=True mode, even if the extra digits are unnecessary to
uniquely specify the value. It is the counterpart to the precision
argument which sets the maximum number of digits to be printed. When
unique=False in fixed precision mode, it has no effect and the precision
argument fixes the number of digits.
(gh-18629)
f2py now recognizes Fortran abstract interface blocks
numpy.f2pycan now parse abstract interface blocks.(gh-18695)
BLAS and LAPACK configuration via environment variables
Autodetection of installed BLAS and LAPACK libraries can be bypassed by
using the
NPY_BLAS_LIBSandNPY_LAPACK_LIBSenvironment variables.Instead, the link flags in these environment variables will be used
directly, and the language is assumed to be F77. This is especially
useful in automated builds where the BLAS and LAPACK that are installed
are known exactly. A use case is replacing the actual implementation at
runtime via stub library links.
If
NPY_CBLAS_LIBSis set (optional in addition toNPY_BLAS_LIBS),this will be used as well, by defining
HAVE_CBLASand appending theenvironment variable content to the link flags.
(gh-18737)
A runtime-subcriptable alias has been added for
ndarraynumpy.typing.NDArrayhas been added, a runtime-subscriptable alias fornp.ndarray[Any, np.dtype[~Scalar]]. The new type alias can be used forannotating arrays with a given dtype and unspecified shape.
NumPy does not support the annotating of array shapes as of 1.21,
this is expected to change in the future though (see
646{.interpreted-text role="pep"}).Examples
(gh-18935)
Improvements
Arbitrary
periodoption fornumpy.unwrapThe size of the interval over which phases are unwrapped is no longer
restricted to
2 * pi. This is especially useful for unwrappingdegrees, but can also be used for other intervals.
(gh-16987)
np.uniquenow returns singleNaNWhen
np.uniqueoperated on an array with multipleNaNentries, itsreturn included a
NaNfor each entry that wasNaNin the originalarray. This is now improved such that the returned array contains just
one
NaNas the last element.Also for complex arrays all
NaNvalues are considered equivalent (nomatter whether the
NaNis in the real or imaginary part). As therepresentant for the returned array the smallest one in the
lexicographical order is chosen - see
np.sortfor how thelexicographical order is defined for complex arrays.
(gh-18070)
Generator.rayleighandGenerator.geometricperformance improvedThe performance of Rayleigh and geometric random variate generation in
Generatorhas improved. These are both transformation of exponentialrandom variables and the slow log-based inverse cdf transformation has
been replaced with the Ziggurat-based exponential variate generator.
This change breaks the stream of variates generated when variates from
either of these distributions are produced.
(gh-18666)
Placeholder annotations have been improved
All placeholder annotations, that were previously annotated as
typing.Any, have been improved. Where appropiate they have beenreplaced with explicit function definitions, classes or other
miscellaneous objects.
(gh-18934)
Performance improvements
Improved performance in integer division of NumPy arrays
Integer division of NumPy arrays now uses
libdivide when the divisor is a constant. With
the usage of libdivide and other minor optimizations, there is a large
speedup. The
//operator andnp.floor_dividemakes use of the newchanges.
(gh-17727)
Improve performance of
np.saveandnp.loadfor small arraysnp.saveis now a lot faster for small arrays.np.loadis also faster for small arrays, but only when serializingwith a version >=
(3, 0).Both are done by removing checks that are only relevant for Python 2,
while still maintaining compatibility with arrays which might have been
created by Python 2.
(gh-18657)
Changes
numpy.piecewiseoutput class now matches the input classWhen
numpy.ndarraysubclasses are used on input tonumpy.piecewise, they are passed on to the functions.The output will now be of the same subclass as well.
(gh-18110)
Enable Accelerate Framework
With the release of macOS 11.3, several different issues that numpy was
encountering when using Accelerate Framework's implementation of BLAS
and LAPACK should be resolved. This change enables the Accelerate
Framework as an option on macOS. If additional issues are found, please
file a bug report against Accelerate using the developer feedback
assistant tool (https://developer.apple.com/bug-reporting/). We intend
to address issues promptly and plan to continue supporting and updating
our BLAS and LAPACK libraries.
(gh-18874)
Checksums
MD5
SHA256
v1.20.3Compare Source
NumPy 1.20.3 Release Notes
NumPy 1.20.3 is a bugfix release containing several fixes merged to the
main branch after the NumPy 1.20.2 release.
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 15 pull requests were merged for this release.
datetime64missing type overload fordatetime.date...__all__in favor of explicit re-exports-faltivecon macOSChecksums
MD5
SHA256
v1.20.2Compare Source
NumPy 1.20.2 Release Notes
NumPy 1,20.2 is a bugfix release containing several fixes merged to the
main branch after the NumPy 1.20.1 release.
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 20 pull requests were merged for this release.
diagflatcould overflow on windows or 32-bit platformscomplex_double_from_pyobj.like=overrides are used__getitem__,__mul__and...whereConfiguration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.