8000 Maintenance/1.21.x by helizaga · Pull Request #19333 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Maintenance/1.21.x #19333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 76 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
8dc7689
Fix compile-time test of POPCNT
cmichal2 May 23, 2021
52d5fe1
Change fix of cpu_popcnt.c to use _mm_popcnt_u64/_mm_popcnt_u32 on GCC
cmichal2 May 23, 2021
3c84e9a
BUG: Fix test_numpy_version.
charris May 23, 2021
32b0261
Merge pull request #19074 from charris/backport-19071
charris May 23, 2021
ad021d3
Merge pull request #19075 from charris/fix-version-problem
charris May 23, 2021
b167abf
MAINT: Update cversions.
charris May 22, 2021
e6ce434
MAINT: Update mailmap.
charris May 23, 2021
11c7008
DOC: Create 1.21.0-changelog.rst
charris May 13, 2021
86a4dd0
DOC: Create 1.21.0 release note
charris May 22, 2021
5cbc580
Merge pull request #19073 from charris/prepare-1.21.0-release
charris May 23, 2021
106088d
BUG: Fixed an issue wherein `_GenericAlias.__getitem__` would raise f…
May 25, 2021
2ed1941
MAINT: Change the variance of the `npt.ArrayLike` to covariant
May 25, 2021
080faad
Merge pull request #19094 from BvB93/generic-alias-bug2
charris May 25, 2021
c3eb82a
BUG: Linter should on run on pull requests.
charris May 24, 2021
25b7d83
Merge pull request #19100 from charris/fix-linter-run-condition
charris May 26, 2021
9b29742
BUG: Fix setup.py to work in maintenance branches.
charris May 25, 2021
a6e0503
Merge pull request #19120 from charris/fix-numpy-version
charris May 28, 2021
264cc43
expose `short_version` as previously in version.py
kif May 31, 2021
e297b3d
BUG: re-introduce short-version as it was
kif May 31, 2021
10f444a
TST: fix pylint
kif May 31, 2021
8cd38bb
TST Fix typo
kif May 31, 2021
a959408
TST fix comment of assert+indentation
kif May 31, 2021
1591e61
Merge pull request #19144 from charris/backport-19142
charris May 31, 2021
334b7cd
API: Delay string and number promotion deprecation/future warning
seberg Jun 4, 2021
95b0352
Merge pull request #19175 from charris/backport-19170
charris Jun 5, 2021
838aae0
BUG, SIMD: Fix detect host/native CPU features on ICC during compile-…
seiko2plus May 25, 2021
e5d2624
Set c99 to intel icc compiler so numpy will build
i-shenl Mar 9, 2021
e3fce2b
Merge pull request #19178 from charris/backport-19098
charris Jun 6, 2021
5e459ce
Merge pull request #19180 from charris/backport-19177
charris Jun 6, 2021
bbdc753
NEP: Accept NEP 35 as final
seberg Jun 7, 2021
82622df
MAINT,BUG: Adapt `castingimpl.casting` to denote a minimal level
seberg Jun 5, 2021
787ee70
Merge pull request #19193 from charris/backport-19188
charris Jun 7, 2021
9fa3b04
Merge pull request #19194 from charris/backport-19174
charris Jun 7, 2021
5567fa9
DOC: Prepare for NumPy 1.20.0rc2 release.
charris Jun 4, 2021
e40a0b2
Merge pull request #19197 from charris/prepare-for-1.21.0rc2
charris Jun 8, 2021
4d1442a
MAINT: Add annotations for the missing `period` parameter to `np.unwrap`
Jun 10, 2021
cb6370e
Merge pull request #19213 from BvB93/unwrap-backport
charris Jun 10, 2021
7a29f54
MAINT: Add `complex` as allowed type for the `np.complexfloating` con…
BvB93 Jun 10, 2021
e9b8f0c
Merge pull request #19219 from BvB93/complex-backport
charris Jun 10, 2021
2def753
TST: Ignore exp FP exceptions test for glibc ver < 2.17
r-devulap Jun 9, 2021
45a322c
BUG: Do not use bare except
r-devulap Jun 9, 2021
9ad1ccb
TST: Use conditional xfail
r-devulap Jun 11, 2021
58805d7
TST: 2 blank lines after class def
r-devulap Jun 11, 2021
1342b96
TST: Getting rid of print
r-devulap Jun 12, 2021
a218e53
Merge pull request #19233 from charris/backport-19209
charris Jun 13, 2021
2aab9c8
MAINT: replace imgmath with mathjax for docs (#19036)
melissawm May 27, 2021
1befa1b
Fix out-of-bounds array access in convert_datetime_divisor_to_multipl…
hawkinsp Jun 9, 2021
d336c26
ENH: support major version larger than 9 in numpy.lib.NumpyVersion
kmaehashi Jun 10, 2021
34c7db0
DOC: fix typo
kmaehashi Jun 10, 2021
8171b01
Merge pull request #19238 from charris/backport-19036
charris Jun 13, 2021
5da37d5
Merge pull request #19240 from charris/backport-19214
charris Jun 13, 2021
a070e5d
Merge pull request #19239 from charris/backport-19402
charris Jun 13, 2021
be642f5
DOC: fix duplicate navbar in development documentation index (#19264)
melissawm Jun 17, 2021
a831463
BUG: Remove TypeError on invalid dtypes comparison
ganesh-k13 Jun 12, 2021
7324532
TST: Check invalid dtypes comparison
ganesh-k13 Jun 12, 2021
5f86809
BUG: Return NotImplemented for unrecognized dtypes
ganesh-k13 Jun 15, 2021
98d88c6
TST: Check invalid dtypes for equality | Check TypeError for comparis…
ganesh-k13 Jun 15, 2021
8000
d80e473
BUG: Removed typing for == and != in dtypes
ganesh-k13 Jun 15, 2021
143d45f
Merge pull request #19269 from charris/backport-19228
charris Jun 17, 2021
61127bb
Merge pull request #19268 from charris/backport-19264
charris Jun 17, 2021
fa5754e
BUG: Add missing DECREF in new path
seberg Jun 18, 2021
7d25b81
BUG: Fix refcount leak in ResultType
seberg Jun 18, 2021
032fca5
Merge pull request #19280 from charris/backport-19277
charris Jun 19, 2021
07d7e72
MAINT: Remove accidentally created directory.
charris Jun 19, 2021
493b64b
MAINT: Update 1.21.0-changelog.rst
charris Jun 19, 2021
34aebc2
MAINT: Update 1.21.0-notes.rst
charris Jun 19, 2021
b235f9e
Merge pull request #19283 from charris/prepare-1.21.0-release
charris Jun 19, 2021
1cfefdf
REL: prepare 1.21.x for further development
charris Jun 22, 2021
4ebcc2b
REV,BUG: Replace `NotImplemented` with `typing.Any`
BvB93 Jun 23, 2021
209cca9
Merge pull request #19311 from BvB93/notimplemented
charris Jun 23, 2021
cd33912
MAINT: Fixed an issue with the return-dtype of `ndarray.real` and `imag
Jun 19, 2021
c532dcd
Merge pull request #19324 from BvB93/real_imag
charris Jun 24, 2021
7d397c2
MAINT: Replace `"dtype[Any]"` with `dtype` in the definiton of `npt.A…
BvB93 Jun 24, 2021
90e7ff1
TST: Test that the `numpy.typing` public API works in combination wit…
BvB93 Jun 24, 2021
c433e54
MAINT: Add a subscriptable runtime-only placeholder for `_SupportsDType`
BvB93 Jun 24, 2021
0e0d490
Merge pull request #19330 from BvB93/runtime
charris Jun 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions numpy/typing/_add_docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _parse_docstrings() -> str:
add_newdoc('NDArray', repr(NDArray),
"""
A :term:`generic <generic type>` version of
`np.ndarray[Any, np.dtype[~ScalarType]] <numpy.ndarray>`.
`np.ndarray[Any, np.dtype[+ScalarType]] <numpy.ndarray>`.

Can be used during runtime for typing arrays with a given dtype
and unspecified shape.
Expand All @@ -127,7 +127,7 @@ def _parse_docstrings() -> str:
>>> import numpy.typing as npt

>>> print(npt.NDArray)
numpy.ndarray[typing.Any, numpy.dtype[~ScalarType]]
numpy.ndarray[typing.Any, numpy.dtype[+ScalarType]]

>>> print(npt.NDArray[np.float64])
numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]]
Expand Down
5 changes: 3 additions & 2 deletions numpy/typing/_generic_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def _reconstruct_alias(alias: _T, parameters: Iterator[TypeVar]) -> _T:
elif isinstance(i, _GenericAlias):
value = _reconstruct_alias(i, parameters)
elif hasattr(i, "__parameters__"):
value = i[next(parameters)]
prm_tup = tuple(next(parameters) for _ in i.__parameters__)
value = i[prm_tup]
else:
value = i
args.append(value)
Expand Down Expand Up @@ -195,7 +196,7 @@ def __getattribute__(self, name: str) -> Any:
else:
_GENERIC_ALIAS_TYPE = (_GenericAlias,)

ScalarType = TypeVar("ScalarType", bound=np.generic)
ScalarType = TypeVar("ScalarType", bound=np.generic, covariant=True)

if TYPE_CHECKING:
NDArray = np.ndarray[Any, np.dtype[ScalarType]]
Expand Down
5 changes: 4 additions & 1 deletion numpy/typing/tests/test_generic_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import numpy as np
from numpy.typing._generic_alias import _GenericAlias

ScalarType = TypeVar("ScalarType", bound=np.generic)
ScalarType = TypeVar("ScalarType", bound=np.generic, covariant=True)
T1 = TypeVar("T1")
T2 = TypeVar("T2")
DType = _GenericAlias(np.dtype, (ScalarType,))
NDArray = _GenericAlias(np.ndarray, (Any, DType))

Expand Down Expand Up @@ -50,6 +52,7 @@ class TestGenericAlias:
("__getitem__", lambda n: n[np.float64]),
("__getitem__", lambda n: n[ScalarType][np.float64]),
("__getitem__", lambda n: n[Union[np.int64, ScalarType]][np.float64]),
("__getitem__", lambda n: n[Union[T1, T2]][np.float32, np.float64]),
("__eq__", lambda n: n == n),
("__ne__", lambda n: n != np.ndarray),
("__dir__", lambda n: dir(n)),
Expand Down
0