You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Incomplete string comparison in the numpy.core component in NumPy1.9.x, which allows attackers to fail the APIs via constructing specific string objects.
NumPy 1.22.0 is a big release featuring the work of 153 contributors
spread over 609 pull requests. There have been many improvements,
highlights are:
Annotations of the main namespace are essentially complete. Upstream
is a moving target, so there will likely be further improvements,
but the major work is done. This is probably the most user visible
enhancement in this release.
A preliminary version of the proposed Array-API is provided. This is
a step in creating a standard collection of functions that can be
used across application such as CuPy and JAX.
NumPy now has a DLPack backend. DLPack provides a common interchange
format for array (tensor) data.
New methods for quantile, percentile, and related functions. The
new methods provide a complete set of the methods commonly found in
the literature.
A new configurable allocator for use by downstream projects.
These are in addition to the ongoing work to provide SIMD support for
commonly used functions, improvements to F2PY, and better documentation.
The Python versions supported in this release are 3.8-3.10, Python 3.7
has been dropped. Note that 32 bit wheels are only provided for Python
3.8 and 3.9 on Windows, all other wheels are 64 bits on account of
Ubuntu, Fedora, and other Linux distributions dropping 32 bit support.
All 64 bit wheels are also linked with 64 bit integer OpenBLAS, which should fix
the occasional problems encountered by folks using truly huge arrays.
Expired deprecations
Deprecated numeric style dtype strings have been removed
Using the strings "Bytes0", "Datetime64", "Str0", "Uint32",
and "Uint64" as a dtype will now raise a TypeError.
Expired deprecations for loads, ndfromtxt, and mafromtxt in npyio
numpy.loads was deprecated in v1.15, with the recommendation that
users use pickle.loads instead. ndfromtxt and mafromtxt were both
deprecated in v1.17 - users should use numpy.genfromtxt instead with
the appropriate value for the usemask parameter.
Passing boolean kth values to (arg-)partition has been deprecated
numpy.partition and numpy.argpartition would previously accept
boolean values for the kth parameter, which would subsequently be
converted into integers. This behavior has now been deprecated.
The numpy.MachAr class and finfo.machar <numpy.finfo> attribute have
been deprecated. Users are encouraged to access the property if interest
directly from the corresponding numpy.finfo attribute.
Distutils forces strict floating point model on clang
NumPy now sets the -ftrapping-math option on clang to enforce correct
floating point error handling for universal functions. Clang defaults to
non-IEEE and C99 conform behaviour otherwise. This change (using the
equivalent but newer -ffp-exception-behavior=strict) was attempted in
NumPy 1.21, but was effectively never used.
numpy.vectorize functions now produce the same output class as the base function
When a function that respects numpy.ndarray subclasses is vectorized
using numpy.vectorize, the vectorized function will now be
subclass-safe also for cases that a signature is given (i.e., when
creating a gufunc): the output class will be the same as that returned
by the first call to the underlying function.
str/repr of complex dtypes now include space after punctuation
The repr of np.dtype({"names": ["a"], "formats": [int], "offsets": [2]}) is now dtype({'names': ['a'], 'formats': ['<i8'], 'offsets': [2], 'itemsize': 10}),
whereas spaces where previously omitted after colons and between fields.
The old behavior can be restored via np.set_printoptions(legacy="1.21").
Fixed a bug in the advance method of PCG64DSXM and PCG64. The bug
only affects results when the step was larger than $2^{64}$ on platforms
that do not support 128-bit integers(e.g., Windows and 32-bit Linux).
Change in generation of random 32 bit floating point variates
There was bug in the generation of 32 bit floating point values from the
uniform distribution that would result in the least significant bit of
the random variate always being 0. This has been fixed.
This change affects the variates produced by the random.Generator
methods random, standard_normal, standard_exponential, and standard_gamma, but only when the dtype is specified as numpy.float32.
The masked inner-loop selector is now never used. A warning will be
given in the unlikely event that it was customized.
We do not expect that any code uses this. If you do use it, you must
unset the selector on newer NumPy version. Please also contact the NumPy
developers, we do anticipate providing a new, more specific, mechanism.
The customization was part of a never-implemented feature to allow for
faster masked operations.
As detailed in NEP 49, the
function used for allocation of the data segment of a ndarray can be
changed. The policy can be set globally or in a context. For more
information see the NEP and the data_memory{.interpreted-text
role="ref"} reference docs. Also add a NUMPY_WARN_IF_NO_MEM_POLICY
override to warn on dangerous use of transfering ownership by setting NPY_ARRAY_OWNDATA.
Implementation of the NEP 47 (adopting the array API standard)
An initial implementation of NEP47, adoption
of the array API standard, has been added as numpy.array_api. The
implementation is experimental and will issue a UserWarning on import,
as the array API standard is still in
draft state. numpy.array_api is a conforming implementation of the
array API standard, which is also minimal, meaning that only those
functions and behaviors that are required by the standard are
implemented (see the NEP for more info). Libraries wishing to make use
of the array API standard are encouraged to use numpy.array_api to
check that they are only using functionality that is guaranteed to be
present in standard conforming implementations.
Assign the platform-specific c_intp precision via a mypy plugin
The mypy plugin, introduced in numpy/numpy#17843, has
again been expanded: the plugin now is now responsible for setting the
platform-specific precision of numpy.ctypeslib.c_intp, the latter
being used as data type for various numpy.ndarray.ctypes attributes.
Without the plugin, aforementioned type will default to ctypes.c_int64.
Add a ndarray.__dlpack__() method which returns a dlpack C structure
wrapped in a PyCapsule. Also add a np._from_dlpack(obj) function,
where obj supports __dlpack__(), and returns an ndarray.
keepdims optional argument added to numpy.argmin, numpy.argmax
keepdims argument is added to numpy.argmin, numpy.argmax. If set
to True, the axes which are reduced are left in the result as
dimensions with size one. The resulting array has the same number of
dimensions and will broadcast with the input array.
bit_count to compute the number of 1-bits in an integer
Computes the number of 1-bits in the absolute value of the input. This
works on all the numpy integer types. Analogous to the builtin int.bit_count or popcount in C++.
Clang-format is a C/C++ code formatter, together with the added .clang-format file, it produces code close enough to the NumPy
C_STYLE_GUIDE for general use. Clang-format version 12+ is required
due to the use of several new features, it is available in Fedora 34 and
Ubuntu Focal among other distributions.
is_integer is now available to numpy.floating and numpy.integer
Based on its counterpart in Python float and int, the numpy floating
point and integer types now support float.is_integer. Returns True
if the number is finite with integral value, and False otherwise.
Symbolic parser for Fortran dimension specifications
A new symbolic parser has been added to f2py in order to correctly parse
dimension specifications. The parser is the basis for future
improvements and provides compatibility with Draft Fortran 202x.
ndarray, dtype and number are now runtime-subscriptable
Mimicking PEP-585, the numpy.ndarray, numpy.dtype and numpy.number classes are now subscriptable for
python 3.9 and later. Consequently, expressions that were previously
only allowed in .pyi stub files or with the help of from __future__ import annotations are now also legal during runtime.
>>> import numpy as np
>>> from typing import Any
>>> np.ndarray[Any, np.dtype[np.float64]]
numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]]
ctypeslib.load_library can now take any path-like object
All parameters in the can now take any python:path-like object{.interpreted-text role="term"}. This includes
the likes of strings, bytes and objects implementing the __fspath__<os.PathLike.__fspath__>{.interpreted-text role="meth"}
protocol.
Add smallest_normal and smallest_subnormal attributes to finfo
The attributes smallest_normal and smallest_subnormal are available
as an extension of finfo class for any floating-point data type. To
use these new attributes, write np.finfo(np.float64).smallest_normal
or np.finfo(np.float64).smallest_subnormal.
numpy.linalg.qr accepts stacked matrices as inputs
numpy.linalg.qr is able to produce results for stacked matrices as
inputs. Moreover, the implementation of QR decomposition has been
shifted to C from Python.
quantile and percentile now have have a method= keyword argument
supporting 13 different methods. This replaces the interpolation=
keyword argument.
The methods are now aligned with nine methods which can be found in
scientific literature and the R language. The remaining methods are the
previous discontinuous variations of the default "linear" one.
Please see the documentation of numpy.percentile for more information.
Missing parameters have been added to the nan<x> functions
A number of the nan<x> functions previously lacked parameters that
were present in their <x>-based counterpart, e.g. the where
parameter was present in numpy.mean but absent from numpy.nanmean.
The following parameters have now been added to the nan<x> functions:
Starting from the 1.20 release, PEP 484 type annotations have been
included for parts of the NumPy library; annotating the remaining
functions being a work in progress. With the release of 1.22 this
process has been completed for the main NumPy namespace, which is now
fully annotated.
Besides the main namespace, a limited number of sub-packages contain
annotations as well. This includes, among others, numpy.testing, numpy.linalg and numpy.random (available since 1.21).
By leveraging Intel Short Vector Math Library (SVML), 18 umath functions
(exp2, log2, log10, expm1, log1p, cbrt, sin, cos, tan, arcsin, arccos, arctan, sinh, cosh, tanh, arcsinh, arccosh, arctanh) are vectorized using AVX-512 instruction set for
both single and double precision implementations. This change is
currently enabled only for Linux users and on processors with AVX-512
instruction set. It provides an average speed up of 32x and 14x for
single and double precision functions respectively.
NumPy 1.21.5 is a maintenance release that fixes a few bugs discovered
after the 1.21.4 release and does some maintenance to extend the 1.21.x
lifetime. The Python versions supported in this release are 3.7-3.10. If
you want to compile your own version using gcc-11, you will need to use
gcc-11.2+ to avoid problems.
Contributors
A total of 7 people contributed to this release. People with a "+" by
their names contributed a patch for the first time.
Bas van Beek
Charles Harris
Matti Picus
Rohit Goswami
Ross Barnowski
Sayed Adel
Sebastian Berg
Pull requests merged
A total of 11 pull requests were merged for this release.
#20357: MAINT: Do not forward __(deep)copy__ calls of _GenericAlias...
#20462: BUG: Fix float16 einsum fastpaths using wrong tempvar
#20463: BUG, DIST: Print os error message when the executable not exist
#20464: BLD: Verify the ability to compile C++ sources before initiating...
#20465: BUG: Force npymath to respect npy_longdouble
#20466: BUG: Fix failure to create aligned, empty structured dtype
#20467: ENH: provide a convenience function to replace npy_load_module
#20495: MAINT: update wheel to version that supports python3.10
#20497: BUG: Clear errors correctly in F2PY conversions
#20613: DEV: add a warningfilter to fix pytest workflow.
#20618: MAINT: Help boost::python libraries at least not crash
The NumPy 1.21.4 is a maintenance release that fixes a few bugs
discovered after 1.21.3. The most important fix here is a fix for the
NumPy header files to make them work for both x86_64 and M1 hardware
when included in the Mac universal2 wheels. Previously, the header files
only worked for M1 and this caused problems for folks building x86_64
extensions. This problem was not seen before Python 3.10 because there
were thin wheels for x86_64 that had precedence. This release also
provides thin x86_64 Mac wheels for Python 3.10.
The Python versions supported in this release are 3.7-3.10. If you want
to compile your own version using gcc-11, you will need to use gcc-11.2+
to avoid problems.
Contributors
A total of 7 people contributed to this release. People with a "+" by
their names contributed a patch for the first time.
Bas van Beek
Charles Harris
Isuru Fernando
Matthew Brett
Sayed Adel
Sebastian Berg
傅立业(Chris Fu) +
Pull requests merged
A total of 9 pull requests were merged for this release.
#20278: BUG: Fix shadowed reference of dtype in type stub
The NumPy 1.21.3 is a maintenance release the fixes a few bugs
discovered after 1.21.2. It also provides 64 bit Python 3.10.0 wheels.
Note a few oddities about Python 3.10:
There are no 32 bit wheels for Windows, Mac, or Linux.
The Mac Intel builds are only available in universal2 wheels.
The Python versions supported in this release are 3.7-3.10. If you want
to compile your own version using gcc-11 you will need to use gcc-11.2+
to avoid problems.
Contributors
A total of 7 people contributed to this release. People with a "+" by
their names contributed a patch for the first time.
Aaron Meurer
Bas van Beek
Charles Harris
Developer-Ecosystem-Engineering +
Kevin Sheppard
Sebastian Berg
Warren Weckesser
Pull requests merged
A total of 8 pull requests were merged for this release.
#19745: ENH: Add dtype-support to 3 `generic/ndarray methods
#19955: BUG: Resolve Divide by Zero on Apple silicon + test failures...
#19958: MAINT: Mark type-check-only ufunc subclasses as ufunc aliases...
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
any of the package files in this branch needs updating, or
the branch becomes conflicted, or
you click the rebase/retry checkbox if found above, or
you rename this PR's title to start with "rebase!" to trigger it manually
The artifact failure details are included below:
File name: Dockerfile-assets/Pipfile.lock
Command failed: pipenv lock
Creating a virtualenv for this project...
Pipfile: /tmp/renovate/repos/github/biosimulators/Biosimulators/Dockerfile-assets/Pipfile
Using /opt/containerbase/tools/python/3.9.19/bin/python (3.9.19) to create virtualenv...
created virtual environment CPython3.9.19.final.0-64 in 3216ms
creator CPython3Posix(dest=/tmp/renovate/cache/others/virtualenvs/Dockerfile-assets-UsBqneob, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/ubuntu/.local/share/virtualenv)
added seed packages: pip==24.0, setuptools==69.5.1, wheel==0.43.0
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
✔ Successfully created virtual environment!
Virtualenv location: /tmp/renovate/cache/others/virtualenvs/Dockerfile-assets-UsBqneob
Locking [packages] dependencies...
False
INFO:pip.subprocessor:Running command git clone --filter=blob:none --quiet https://github.com/biosimulators/RBApy.git /tmp/pip-temp-k3f8yeks/rbapy_55d819d3d5864f56bf6285c292b013ba
ERROR:pip.subprocessor:Getting requirements to build wheel exited with 1
[ResolutionFailure]: File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/resolver.py", line 645, in _main
[ResolutionFailure]: resolve_packages(
[ResolutionFailure]: File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/resolver.py", line 612, in resolve_packages
[ResolutionFailure]: results, resolver = resolve(
[ResolutionFailure]: File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/resolver.py", line 592, in resolve
[ResolutionFailure]: return resolve_deps(
[ResolutionFailure]: File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/utils/resolver.py", line 918, in resolve_deps
[ResolutionFailure]: results, hashes, internal_resolver = actually_resolve_deps(
[ResolutionFailure]: File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/utils/resolver.py", line 691, in actually_resolve_deps
[ResolutionFailure]: resolver.resolve()
[ResolutionFailure]: File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/utils/resolver.py", line 448, in resolve
[ResolutionFailure]: raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
You can use $ pipenv run pip install <requirement_name> to bypass this mechanism, then run $ pipenv graph to inspect the versions actually installed in the virtualenv.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: Getting requirements to build wheel exited with 1
Traceback (most recent call last):
File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/bin/pipenv", line 8, in <module>
sys.exit(cli())
File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/cli/options.py", line 58, in main
return super().main(*args, **kwargs, windows_expand_args=False)
File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/vendor/click/decorators.py", line 92, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/vendor/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/cli/command.py", line 340, in lock
do_lock(
File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/routines/lock.py", line 65, in do_lock
venv_resolve_deps(
File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/utils/resolver.py", line 859, in venv_resolve_deps
c = resolve(cmd, st, project=project)
File "/opt/containerbase/tools/pipenv/2023.12.1/3.9.19/lib/python3.9/site-packages/pipenv/utils/resolver.py", line 728, in resolve
raise RuntimeError("Failed to lock Pipfile.lock!")
RuntimeError: Failed to lock Pipfile.lock!
renovateBot
changed the title
chore(deps): update dependency numpy to <1.23.6 [security]
chore(deps): update dependency numpy to v1 [security]
Nov 20, 2022
renovateBot
changed the title
chore(deps): update dependency numpy to v1 [security]
chore(deps): update dependency numpy to <1.23.6 [security]
Nov 29, 2022
renovateBot
changed the title
chore(deps): update dependency numpy to <1.23.6 [security]
chore(deps): update dependency numpy to v1 [security]
Nov 29, 2022
renovateBot
changed the title
chore(deps): update dependency numpy to v1 [security]
chore(deps): update dependency numpy to <1.23.6 [security]
Nov 30, 2022
renovateBot
changed the title
chore(deps): update dependency numpy to <1.23.6 [security]
chore(deps): update dependency numpy to v1 [security]
Nov 30, 2022
renovateBot
changed the title
chore(deps): update dependency numpy to v1 [security]
chore(deps): update dependency numpy to <1.23.6 [security]
Dec 9, 2022
renovateBot
changed the title
chore(deps): update dependency numpy to <1.23.6 [security]
chore(deps): update dependency numpy to v1 [security]
Dec 9, 2022
renovateBot
changed the title
chore(deps): update dependency numpy to v1 [security]
chore(deps): update dependency numpy to <1.23.6 [security]
Dec 10, 2022
renovateBot
changed the title
chore(deps): update dependency numpy to <1.23.6 [security]
chore(deps): update dependency numpy to v1 [security]
Dec 10, 2022
renovateBot
changed the title
chore(deps): update dependency numpy to v1 [security]
chore(deps): update dependency numpy to <1.23.6 [security]
Dec 14, 2022
renovateBot
changed the title
chore(deps): update dependency numpy to <1.23.6 [security]
chore(deps): update dependency numpy to v1 [security]
Dec 14, 2022
renovateBot
changed the title
chore(deps): update dependency numpy to v1 [security]
chore(deps): update dependency numpy to <1.23.6 [security]
Dec 17, 2022
renovateBot
changed the title
chore(deps): update dependency numpy to <1.24.2 [security]
chore(deps): update dependency numpy to v1 [security]
Jan 6, 2023
renovateBot
changed the title
chore(deps): update dependency numpy to v1 [security]
chore(deps): update dependency numpy to <1.24.2 [security]
Jan 17, 2023
renovateBot
changed the title
chore(deps): update dependency numpy to <1.24.2 [security]
chore(deps): update dependency numpy to v1 [security]
Jan 18, 2023
renovateBot
changed the title
chore(deps): update dependency numpy to v1 [security]
chore(deps): update dependency numpy to <1.24.2 [security]
Jan 24, 2023
renovateBot
changed the title
chore(deps): update dependency numpy to <1.24.2 [security]
chore(deps): update dependency numpy to v1 [security]
Jan 24, 2023
renovateBot
changed the title
chore(deps): update dependency numpy to v1 [security]
chore(deps): update dependency numpy to <1.24.2 [security]
Feb 1, 2023
renovateBot
changed the title
chore(deps): update dependency numpy to <1.24.2 [security]
chore(deps): update dependency numpy to v1 [security]
Feb 1, 2023
renovateBot
changed the title
chore(deps): update dependency numpy to v1 [security]
chore(deps): update dependency numpy to <1.24.3 [security]
Feb 11, 2023
renovateBot
changed the title
chore(deps): update dependency numpy to <1.24.3 [security]
chore(deps): update dependency numpy to v1 [security]
Feb 11, 2023
renovateBot
changed the title
chore(deps): update dependency numpy to v1 [security]
chore(deps): update dependency numpy to <1.24.3 [security]
Feb 20, 2023
renovateBot
changed the title
chore(deps): update dependency numpy to <1.24.3 [security]
chore(deps): update dependency numpy to v1 [security]
Feb 20, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.22.1Incorrect Comparison in NumPy
CVE-2021-34141 / GHSA-fpfv-jqm9-f5jm
More information
Details
Incomplete string comparison in the numpy.core component in NumPy1.9.x, which allows attackers to fail the APIs via constructing specific string objects.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
numpy/numpy (numpy)
v1.22.0Compare Source
NumPy 1.22.0 Release Notes
NumPy 1.22.0 is a big release featuring the work of 153 contributors
spread over 609 pull requests. There have been many improvements,
highlights are:
is a moving target, so there will likely be further improvements,
but the major work is done. This is probably the most user visible
enhancement in this release.
a step in creating a standard collection of functions that can be
used across application such as CuPy and JAX.
format for array (tensor) data.
quantile,percentile, and related functions. Thenew methods provide a complete set of the methods commonly found in
the literature.
These are in addition to the ongoing work to provide SIMD support for
commonly used functions, improvements to F2PY, and better documentation.
The Python versions supported in this release are 3.8-3.10, Python 3.7
has been dropped. Note that 32 bit wheels are only provided for Python
3.8 and 3.9 on Windows, all other wheels are 64 bits on account of
Ubuntu, Fedora, and other Linux distributions dropping 32 bit support.
All 64 bit wheels are also linked with 64 bit integer OpenBLAS, which should fix
the occasional problems encountered by folks using truly huge arrays.
Expired deprecations
Deprecated numeric style dtype strings have been removed
Using the strings
"Bytes0","Datetime64","Str0","Uint32",and
"Uint64"as a dtype will now raise aTypeError.(gh-19539)
Expired deprecations for
loads,ndfromtxt, andmafromtxtin npyionumpy.loadswas deprecated in v1.15, with the recommendation thatusers use
pickle.loadsinstead.ndfromtxtandmafromtxtwere bothdeprecated in v1.17 - users should use
numpy.genfromtxtinstead withthe appropriate value for the
usemaskparameter.(gh-19615)
Deprecations
Use delimiter rather than delimitor as kwarg in mrecords
The misspelled keyword argument
delimitorofnumpy.ma.mrecords.fromtextfile()has been changed todelimiter,using it will emit a deprecation warning.
(gh-19921)
Passing boolean
kthvalues to (arg-)partition has been deprecatednumpy.partitionandnumpy.argpartitionwould previously acceptboolean values for the
kthparameter, which would subsequently beconverted into integers. This behavior has now been deprecated.
(gh-20000)
The
np.MachArclass has been deprecatedThe
numpy.MachArclass andfinfo.machar <numpy.finfo>attribute havebeen deprecated. Users are encouraged to access the property if interest
directly from the corresponding
numpy.finfoattribute.(gh-20201)
Compatibility notes
Distutils forces strict floating point model on clang
NumPy now sets the
-ftrapping-mathoption on clang to enforce correctfloating point error handling for universal functions. Clang defaults to
non-IEEE and C99 conform behaviour otherwise. This change (using the
equivalent but newer
-ffp-exception-behavior=strict) was attempted inNumPy 1.21, but was effectively never used.
(gh-19479)
Removed floor division support for complex types
Floor division of complex types will now result in a
TypeError(gh-19135)
numpy.vectorizefunctions now produce the same output class as the base functionWhen a function that respects
numpy.ndarraysubclasses is vectorizedusing
numpy.vectorize, the vectorized function will now besubclass-safe also for cases that a signature is given (i.e., when
creating a
gufunc): the output class will be the same as that returnedby the first call to the underlying function.
(gh-19356)
Python 3.7 is no longer supported
Python support has been dropped. This is rather strict, there are
changes that require Python >= 3.8.
(gh-19665)
str/repr of complex dtypes now include space after punctuation
The repr of
np.dtype({"names": ["a"], "formats": [int], "offsets": [2]})is nowdtype({'names': ['a'], 'formats': ['<i8'], 'offsets': [2], 'itemsize': 10}),whereas spaces where previously omitted after colons and between fields.
The old behavior can be restored via
np.set_printoptions(legacy="1.21").(gh-19687)
Corrected
advanceinPCG64DSXMandPCG64Fixed a bug in the$2^{64}$ on platforms
advancemethod ofPCG64DSXMandPCG64. The bugonly affects results when the step was larger than
that do not support 128-bit integers(e.g., Windows and 32-bit Linux).
(gh-20049)
Change in generation of random 32 bit floating point variates
There was bug in the generation of 32 bit floating point values from the
uniform distribution that would result in the least significant bit of
the random variate always being 0. This has been fixed.
This change affects the variates produced by the
random.Generatormethods
random,standard_normal,standard_exponential, andstandard_gamma, but only when the dtype is specified asnumpy.float32.(gh-20314)
C API changes
Masked inner-loops cannot be customized anymore
The masked inner-loop selector is now never used. A warning will be
given in the unlikely event that it was customized.
We do not expect that any code uses this. If you do use it, you must
unset the selector on newer NumPy version. Please also contact the NumPy
developers, we do anticipate providing a new, more specific, mechanism.
The customization was part of a never-implemented feature to allow for
faster masked operations.
(gh-19259)
New Features
NEP 49 configurable allocators
As detailed in NEP 49, the
function used for allocation of the data segment of a ndarray can be
changed. The policy can be set globally or in a context. For more
information see the NEP and the
data_memory{.interpreted-textrole="ref"} reference docs. Also add a
NUMPY_WARN_IF_NO_MEM_POLICYoverride to warn on dangerous use of transfering ownership by setting
NPY_ARRAY_OWNDATA.(gh-17582)
Implementation of the NEP 47 (adopting the array API standard)
An initial implementation of NEP47, adoption
of the array API standard, has been added as
numpy.array_api. Theimplementation is experimental and will issue a UserWarning on import,
as the array API standard is still in
draft state.
numpy.array_apiis a conforming implementation of thearray API standard, which is also minimal, meaning that only those
functions and behaviors that are required by the standard are
implemented (see the NEP for more info). Libraries wishing to make use
of the array API standard are encouraged to use
numpy.array_apitocheck that they are only using functionality that is guaranteed to be
present in standard conforming implementations.
(gh-18585)
Generate C/C++ API reference documentation from comments blocks is now possible
This feature depends on Doxygen in
the generation process and on
Breathe to integrate it
with Sphinx.
(gh-18884)
Assign the platform-specific
c_intpprecision via a mypy pluginThe mypy plugin, introduced in
numpy/numpy#17843, has
again been expanded: the plugin now is now responsible for setting the
platform-specific precision of
numpy.ctypeslib.c_intp, the latterbeing used as data type for various
numpy.ndarray.ctypesattributes.Without the plugin, aforementioned type will default to
ctypes.c_int64.To enable the plugin, one must add it to their mypy configuration
file:
(gh-19062)
Add NEP 47-compatible dlpack support
Add a
ndarray.__dlpack__()method which returns adlpackC structurewrapped in a
PyCapsule. Also add anp._from_dlpack(obj)function,where
objsupports__dlpack__(), and returns anndarray.(gh-19083)
keepdimsoptional argument added tonumpy.argmin,numpy.argmaxkeepdimsargument is added tonumpy.argmin,numpy.argmax. If setto
True, the axes which are reduced are left in the result asdimensions with size one. The resulting array has the same number of
dimensions and will broadcast with the input array.
(gh-19211)
bit_countto compute the number of 1-bits in an integerComputes the number of 1-bits in the absolute value of the input. This
works on all the numpy integer types. Analogous to the builtin
int.bit_countorpopcountin C++.(gh-19355)
The
ndimandaxisattributes have been added tonumpy.AxisErrorThe
ndimandaxisparameters are now also stored as attributeswithin each
numpy.AxisErrorinstance.(gh-19459)
Preliminary support for
windows/arm64targetnumpyadded support for windows/arm64 target. Please noteOpenBLASsupport is not yet available for windows/arm64 target.
(gh-19513)
Added support for LoongArch
LoongArch is a new instruction set, numpy compilation failure on
LoongArch architecture, so add the commit.
(gh-19527)
A
.clang-formatfile has been addedClang-format is a C/C++ code formatter, together with the added
.clang-formatfile, it produces code close enough to the NumPyC_STYLE_GUIDE for general use. Clang-format version 12+ is required
due to the use of several new features, it is available in Fedora 34 and
Ubuntu Focal among other distributions.
(gh-19754)
is_integeris now available tonumpy.floatingandnumpy.integerBased on its counterpart in Python
floatandint, the numpy floatingpoint and integer types now support
float.is_integer. ReturnsTrueif the number is finite with integral value, and
Falseotherwise.(gh-19803)
Symbolic parser for Fortran dimension specifications
A new symbolic parser has been added to f2py in order to correctly parse
dimension specifications. The parser is the basis for future
improvements and provides compatibility with Draft Fortran 202x.
(gh-19805)
ndarray,dtypeandnumberare now runtime-subscriptableMimicking PEP-585, the
numpy.ndarray,numpy.dtypeandnumpy.numberclasses are now subscriptable forpython 3.9 and later. Consequently, expressions that were previously
only allowed in .pyi stub files or with the help of
from __future__ import annotationsare now also legal during runtime.(gh-19879)
Improvements
ctypeslib.load_librarycan now take any path-like objectAll parameters in the can now take any
python:path-like object{.interpreted-text role="term"}. This includesthe likes of strings, bytes and objects implementing the
__fspath__<os.PathLike.__fspath__>{.interpreted-text role="meth"}protocol.
(gh-17530)
Add
smallest_normalandsmallest_subnormalattributes tofinfoThe attributes
smallest_normalandsmallest_subnormalare availableas an extension of
finfoclass for any floating-point data type. Touse these new attributes, write
np.finfo(np.float64).smallest_normalor
np.finfo(np.float64).smallest_subnormal.(gh-18536)
numpy.linalg.qraccepts stacked matrices as inputsnumpy.linalg.qris able to produce results for stacked matrices asinputs. Moreover, the implementation of QR decomposition has been
shifted to C from Python.
(gh-19151)
numpy.fromregexnow acceptsos.PathLikeimplementationsnumpy.fromregexnow accepts objects implementing the__fspath__<os.PathLike>protocol, e.g.pathlib.Path.(gh-19680)
Add new methods for
quantileandpercentilequantileandpercentilenow have have amethod=keyword argumentsupporting 13 different methods. This replaces the
interpolation=keyword argument.
The methods are now aligned with nine methods which can be found in
scientific literature and the R language. The remaining methods are the
previous discontinuous variations of the default "linear" one.
Please see the documentation of
numpy.percentilefor more information.(gh-19857)
Missing parameters have been added to the
nan<x>functionsA number of the
nan<x>functions previously lacked parameters thatwere present in their
<x>-based counterpart, e.g. thewhereparameter was present in
numpy.meanbut absent fromnumpy.nanmean.The following parameters have now been added to the
nan<x>functions:initial&whereinitial&wherekeepdims&outkeepdims&outinitial&whereinitial&wherewherewherewhere(gh-20027)
Annotating the main Numpy namespace
Starting from the 1.20 release, PEP 484 type annotations have been
included for parts of the NumPy library; annotating the remaining
functions being a work in progress. With the release of 1.22 this
process has been completed for the main NumPy namespace, which is now
fully annotated.
Besides the main namespace, a limited number of sub-packages contain
annotations as well. This includes, among others,
numpy.testing,numpy.linalgandnumpy.random(available since 1.21).(gh-20217)
Vectorize umath module using AVX-512
By leveraging Intel Short Vector Math Library (SVML), 18 umath functions
(
exp2,log2,log10,expm1,log1p,cbrt,sin,cos,tan,arcsin,arccos,arctan,sinh,cosh,tanh,arcsinh,arccosh,arctanh) are vectorized using AVX-512 instruction set forboth single and double precision implementations. This change is
currently enabled only for Linux users and on processors with AVX-512
instruction set. It provides an average speed up of 32x and 14x for
single and double precision functions respectively.
(gh-19478)
OpenBLAS v0.3.18
Update the OpenBLAS used in testing and in wheels to v0.3.18
(gh-20058)
Checksums
MD5
SHA256
v1.21.6Compare Source
NumPy 1.21.6 Release Notes
NumPy 1.21.6 is a very small release that achieves two things:
The provision of the 32 bit wheel is intended to make life easier for
oldest-supported-numpy.
Checksums
MD5
SHA256
v1.21.5Compare Source
NumPy 1.21.5 Release Notes
NumPy 1.21.5 is a maintenance release that fixes a few bugs discovered
after the 1.21.4 release and does some maintenance to extend the 1.21.x
lifetime. The Python versions supported in this release are 3.7-3.10. If
you want to compile your own version using gcc-11, you will need to use
gcc-11.2+ to avoid problems.
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 11 pull requests were merged for this release.
__(deep)copy__calls of_GenericAlias...npymathto respectnpy_longdoublenpy_load_moduleChecksums
MD5
SHA256
v1.21.4Compare Source
NumPy 1.21.4 Release Notes
The NumPy 1.21.4 is a maintenance release that fixes a few bugs
discovered after 1.21.3. The most important fix here is a fix for the
NumPy header files to make them work for both x86_64 and M1 hardware
when included in the Mac universal2 wheels. Previously, the header files
only worked for M1 and this caused problems for folks building x86_64
extensions. This problem was not seen before Python 3.10 because there
were thin wheels for x86_64 that had precedence. This release also
provides thin x86_64 Mac wheels for Python 3.10.
The Python versions supported in this release are 3.7-3.10. If you want
to compile your own version using gcc-11, you will need to use gcc-11.2+
to avoid problems.
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 9 pull requests were merged for this release.
dtypein type stubVOID_nonzerocould sometimes mutate alignment flagArrayteratortyping test failureChecksums
MD5
SHA256
v1.21.3Compare Source
NumPy 1.21.3 Release Notes
The NumPy 1.21.3 is a maintenance release the fixes a few bugs
discovered after 1.21.2. It also provides 64 bit Python 3.10.0 wheels.
Note a few oddities about Python 3.10:
The Python versions supported in this release are 3.7-3.10. If you want
to compile your own version using gcc-11 you will need to use gcc-11.2+
to avoid problems.
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 8 pull requests were merged for this release.
`generic/ndarraymethodsChecksums
MD5
SHA256