This repository was archived by the owner on Mar 20, 2023. It is now read-only.
Update dependency numpy to v1.24.2 #13
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.22.0->==1.24.2Release Notes
numpy/numpy
v1.24.2Compare Source
NumPy 1.24.2 Release Notes
NumPy 1.24.2 is a maintenance release that fixes bugs and regressions
discovered after the 1.24.1 release. The Python versions supported by
this release are 3.8-3.11.
Contributors
A total of 14 people contributed to this release. People with a "+" by
their names contributed a patch for the first time.
Pull requests merged
A total of 17 pull requests were merged for this release.
_Alignofrather thanoffsetof()on most compilersAnyparameter to thenpt.ArrayLike...Checksums
MD5
SHA256
v1.24.1Compare Source
NumPy 1.24.1 Release Notes
NumPy 1.24.1 is a maintenance release that fixes bugs and regressions
discovered after the 1.24.0 release. The Python versions supported by
this release are 3.8-3.11.
Contributors
A total of 12 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.
charset_normalizer.Checksums
MD5
SHA256
v1.24.0Compare Source
NumPy 1.24 Release Notes
The NumPy 1.24.0 release continues the ongoing work to improve the
handling and promotion of dtypes, increase the execution speed, and
clarify the documentation. There are also a large number of new and
expired deprecations due to changes in promotion and cleanups. This
might be called a deprecation release. Highlights are
See below for the details,
This release supports Python versions 3.8-3.11.
Deprecations
Deprecate fastCopyAndTranspose and PyArray_CopyAndTranspose
The
numpy.fastCopyAndTransposefunction has been deprecated. Use thecorresponding copy and transpose methods directly:
The underlying C function
PyArray_CopyAndTransposehas also beendeprecated from the NumPy C-API.
(gh-22313)
Conversion of out-of-bound Python integers
Attempting a conversion from a Python integer to a NumPy value will now
always check whether the result can be represented by NumPy. This means
the following examples will fail in the future and give a
DeprecationWarningnow:Many of these did succeed before. Such code was mainly useful for
unsigned integers with negative values such as
np.uint8(-1)givingnp.iinfo(np.uint8).max.Note that conversion between NumPy integers is unaffected, so that
np.array(-1).astype(np.uint8)continues to work and use C integeroverflow logic. For negative values, it will also work to view the
array:
np.array(-1, dtype=np.int8).view(np.uint8). In some cases,using
np.iinfo(np.uint8).maxorval % 2**8may also work well.In rare cases input data may mix both negative values and very large
unsigned values (i.e.
-1and2**63). There it is unfortunatelynecessary to use
%on the Python value or use signed or unsignedconversion depending on whether negative values are expected.
(gh-22385)
Deprecate
msortThe
numpy.msortfunction is deprecated. Usenp.sort(a, axis=0)instead.
(gh-22456)
np.str0and similar are now deprecatedThe scalar type aliases ending in a 0 bit size:
np.object0,np.str0,np.bytes0,np.void0,np.int0,np.uint0as well asnp.bool8arenow deprecated and will eventually be removed.
(gh-22607)
Expired deprecations
The
normedkeyword argument has been removed from[np.histogram]{.title-ref}, [np.histogram2d]{.title-ref}, and
[np.histogramdd]{.title-ref}. Use
densityinstead. Ifnormedwaspassed by position,
densityis now used.(gh-21645)
Ragged array creation will now always raise a
ValueErrorunlessdtype=objectis passed. This includes very deeply nestedsequences.
(gh-22004)
Support for Visual Studio 2015 and earlier has been removed.
Support for the Windows Interix POSIX interop layer has been
removed.
(gh-22139)
Support for Cygwin < 3.3 has been removed.
(gh-22159)
The mini() method of
np.ma.MaskedArrayhas been removed. Useeither
np.ma.MaskedArray.min()ornp.ma.minimum.reduce().The single-argument form of
np.ma.minimumandnp.ma.maximumhasbeen removed. Use
np.ma.minimum.reduce()ornp.ma.maximum.reduce()instead.(gh-22228)
Passing dtype instances other than the canonical (mainly native
byte-order) ones to
dtype=orsignature=in ufuncs will nowraise a
TypeError. We recommend passing the strings"int8"orscalar types
np.int8since the byte-order, datetime/timedeltaunit, etc. are never enforced. (Initially deprecated in NumPy 1.21.)
(gh-22540)
The
dtype=argument to comparison ufuncs is now applied correctly.That means that only
boolandobjectare valid values anddtype=objectis enforced.(gh-22541)
The deprecation for the aliases
np.object,np.bool,np.float,np.complex,np.str, andnp.intis expired (introduces NumPy1.20). Some of these will now give a FutureWarning in addition to
raising an error since they will be mapped to the NumPy scalars in
the future.
(gh-22607)
Compatibility notes
array.fill(scalar)may behave slightly differentnumpy.ndarray.fillmay in some cases behave slightly different now dueto the fact that the logic is aligned with item assignment:
is now identical to:
Previously casting may have produced slightly different answers when
using values that could not be represented in the target
dtypeor whenthe target had
objectdtype.(gh-20924)
Subarray to object cast now copies
Casting a dtype that includes a subarray to an object will now ensure a
copy of the subarray. Previously an unsafe view was returned:
Is now always false. While previously it was true for the specific cast.
(gh-21925)
Returned arrays respect uniqueness of dtype kwarg objects
When the
dtypekeyword argument is used with:py
np.array(){.interpreted-text role="func"} or:py
asarray(){.interpreted-text role="func"}, the dtype of the returnedarray now always exactly matches the dtype provided by the caller.
In some cases this change means that a view rather than the input
array is returned. The following is an example for this on 64bit Linux
where
longandlonglongare the same precision but differentdtypes:Before the change, the
dtypedid not match becausenew is arrwasTrue.(gh-21995)
DLPack export raises
BufferErrorWhen an array buffer cannot be exported via DLPack a
BufferErrorisnow always raised where previously
TypeErrororRuntimeErrorwasraised. This allows falling back to the buffer protocol or
__array_interface__when DLPack was tried first.(gh-22542)
NumPy builds are no longer tested on GCC-6
Ubuntu 18.04 is deprecated for GitHub actions and GCC-6 is not available
on Ubuntu 20.04, so builds using that compiler are no longer tested. We
still test builds using GCC-7 and GCC-8.
(gh-22598)
New Features
New attribute
symboladded to polynomial classesThe polynomial classes in the
numpy.polynomialpackage have a newsymbolattribute which is used to represent the indeterminate of thepolynomial. This can be used to change the value of the variable when
printing:
Note that the polynomial classes only support 1D polynomials, so
operations that involve polynomials with different symbols are
disallowed when the result would be multivariate:
The symbol can be any valid Python identifier. The default is
symbol=x, consistent with existing behavior.(gh-16154)
F2PY support for Fortran
characterstringsF2PY now supports wrapping Fortran functions with:
character x)character, dimension(n) :: x)character(len=10) x)character(len=10), dimension(n, m) :: x)arguments, including passing Python unicode strings as Fortran character
string arguments.
(gh-19388)
New function
np.show_runtimeA new function
numpy.show_runtimehas been added to display theruntime information of the machine in addition to
numpy.show_configwhich displays the build-related information.
(gh-21468)
strictoption fortesting.assert_array_equalThe
strictoption is now available fortesting.assert_array_equal.Setting
strict=Truewill disable the broadcasting behaviour forscalars and ensure that input arrays have the same data type.
(gh-21595)
New parameter
equal_nanadded tonp.uniquenp.uniquewas changed in 1.21 to treat allNaNvalues as equal andreturn a single
NaN. Settingequal_nan=Falsewill restore pre-1.21behavior to treat
NaNsas unique. Defaults toTrue.(gh-21623)
castinganddtypekeyword arguments fornumpy.stackThe
castinganddtypekeyword arguments are now available fornumpy.stack. To use them, writenp.stack(..., dtype=None, casting='same_kind').castinganddtypekeyword arguments fornumpy.vstackThe
castinganddtypekeyword arguments are now available fornumpy.vstack. To use them, writenp.vstack(..., dtype=None, casting='same_kind').castinganddtypekeyword arguments fornumpy.hstackThe
castinganddtypekeyword arguments are now available fornumpy.hstack. To use them, writenp.hstack(..., dtype=None, casting='same_kind').(gh-21627)
The bit generator underlying the singleton RandomState can be changed
The singleton
RandomStateinstance exposed in thenumpy.randommodule is initialized at startup with the
MT19937bit generator. Thenew function
set_bit_generatorallows the default bit generator to bereplaced with a user-provided bit generator. This function has been
introduced to provide a method allowing seamless integration of a
high-quality, modern bit generator in new code with existing code that
makes use of the singleton-provided random variate generating functions.
The companion function
get_bit_generatorreturns the current bitgenerator being used by the singleton
RandomState. This is provided tosimplify restoring the original source of randomness if required.
The preferred method to generate reproducible random numbers is to use a
modern bit generator in an instance of
Generator. The functiondefault_rngsimplifies instantiation:The same bit generator can then be shared with the singleton instance so
that calling functions in the
randommodule will use the same bitgenerator:
The swap is permanent (until reversed) and so any call to functions in
the
randommodule will use the new bit generator. The original can berestored if required for code to run correctly:
(gh-21976)
np.voidnow has adtypeargumentNumPy now allows constructing structured void scalars directly by
passing the
dtypeargument tonp.void.(gh-22316)
Improvements
F2PY Improvements
API anymore
f2pygenerated exception messagesflake8warning fixessignature files are prefixed with
f2py_. For example, one shoulduse
f2py_len(x)instead oflen(x)character(f2py_len=...)is introduced to supportreturning assumed length character strings (e.g.
character(len=*))from wrapper functions
A hook to support rewriting
f2pyinternal data structures afterreading all its input files is introduced. This is required, for
instance, for BC of SciPy support where character arguments are treated
as character strings arguments in
Cexpressions.(gh-19388)
IBM zSystems Vector Extension Facility (SIMD)
Added support for SIMD extensions of zSystem (z13, z14, z15), through
the universal intrinsics interface. This support leads to performance
improvements for all SIMD kernels implemented using the universal
intrinsics, including the following operations: rint, floor, trunc,
ceil, sqrt, absolute, square, reciprocal, tanh, sin, cos, equal,
not_equal, greater, greater_equal, less, less_equal, maximum, minimum,
fmax, fmin, argmax, argmin, add, subtract, multiply, divide.
(gh-20913)
NumPy now gives floating point errors in casts
In most cases, NumPy previously did not give floating point warnings or
errors when these happened during casts. For examples, casts like:
Should now generally give floating point warnings. These warnings should
warn that floating point overflow occurred. For errors when converting
floating point values to integers users should expect invalid value
warnings.
Users can modify the behavior of these warnings using
np.errstate.Note that for float to int casts, the exact warnings that are given may
be platform dependent. For example:
May give a result equivalent to (the intermediate cast means no warning
is given):
May return an undefined result, with a warning set:
The precise behavior is subject to the C99 standard and its
implementation in both software and hardware.
(gh-21437)
F2PY supports the value attribute
The Fortran standard requires that variables declared with the
valueattribute must be passed by value instead of reference. F2PY now
supports this use pattern correctly. So
integer, intent(in), value :: xin Fortran codes will have correctwrappers generated.
(gh-21807)
Added pickle support for third-party BitGenerators
The pickle format for bit generators was extended to allow each bit
generator to supply its own constructor when during pickling. Previous
versions of NumPy only supported unpickling
Generatorinstancescreated with one of the core set of bit generators supplied with NumPy.
Attempting to unpickle a
Generatorthat used a third-party bitgenerators would fail since the constructor used during the unpickling
was only aware of the bit generators included in NumPy.
(gh-22014)
arange() now explicitly fails with dtype=str
Previously, the
np.arange(n, dtype=str)function worked forn=1andn=2, but would raise a non-specific exception message for other valuesof
n. Now, it raises a [TypeError]{.title-ref} informing thatarangedoes not support string dtypes:
(gh-22055)
numpy.typingprotocols are now runtime checkableThe protocols used in
numpy.typing.ArrayLikeandnumpy.typing.DTypeLikeare now properly marked as runtime checkable,making them easier to use for runtime type checkers.
(gh-22357)
Performance improvements and changes
Faster version of
np.isinandnp.in1dfor integer arraysnp.in1d(used bynp.isin) can now switch to a faster algorithm (upto >10x faster) when it is passed two integer arrays. This is often
automatically used, but you can use
kind="sort"orkind="table"toforce the old or new method, respectively.
(gh-12065)
Faster comparison operators
The comparison functions (
numpy.equal,numpy.not_equal,numpy.less,numpy.less_equal,numpy.greaterandnumpy.greater_equal) are now much faster as they are now vectorizedwith universal intrinsics. For a CPU with SIMD extension AVX512BW, the
performance gain is up to 2.57x, 1.65x and 19.15x for integer, float and
boolean data types, respectively (with N=50000).
(gh-21483)
Changes
Better reporting of integer division overflow
Integer division overflow of scalars and arrays used to provide a
RuntimeWarningand the return value was undefined leading to crashesat rare occasions:
Integer division overflow now returns the input dtype's minimum value
and raise the following
RuntimeWarning:(gh-21506)
masked_invalidnow modifies the mask in-placeWhen used with
copy=False,numpy.ma.masked_invalidnow modifies theinput masked array in-place. This makes it behave identically to
masked_whereand better matches the documentation.(gh-22046)
nditer/NpyIterallows all allocating all operandsThe NumPy iterator available through
np.nditerin Python and asNpyIterin C now supports allocating all arrays. The iterator shapedefaults to
()in this case. The operands dtype must be provided,since a "common dtype" cannot be inferred from the other inputs.
(gh-22457)
Checksums
MD5
SHA256
v1.23.5Compare Source
NumPy 1.23.5 Release Notes
NumPy 1.23.5 is a maintenance release that fixes bugs discovered after
the 1.23.4 release and keeps the build infrastructure current. The
Python versions supported for this release are 3.8-3.11.
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 10 pull requests were merged for this release.
random.logseriesChecksums
MD5
SHA256
v1.23.4Compare Source
NumPy 1.23.4 Release Notes
NumPy 1.23.4 is a maintenance release that fixes bugs discovered after
the 1.23.3 release and keeps the build infrastructure current. The main
improvements are fixes for some annotation corner cases, a fix for a
long time
nested_itersmemory leak, and a fix of complex vector dotfor very large arrays. The Python versions supported for this release
are 3.8-3.11.
Note that the mypy version needs to be 0.981+ if you test using Python
3.10.7, otherwise the typing tests will fail.
Contributors
A total of 8 people contributed to this release. People with a "+" by
their names contributed a patch for the first time.
Pull requests merged
A total of 13 pull requests were merged for this release.
__array_api_version__tonumpy.array_apinamespaceget_infofrom "extending with Cython"...lookfor's import try/except againnumpy.typingprotocols as runtime checkableChecksums
MD5
SHA256
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - 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 Mend Renovate. View repository job log here.