Skip to content

Commit 43bcac0

Browse files
authored
Merge pull request #501 from numpy/120
2 parents ff3a000 + cb9e40c commit 43bcac0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1318
-718
lines changed

.vscode/settings.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
22
"[markdown]": {
3-
"editor.rulers": [130]
3+
"editor.rulers": [
4+
120
5+
]
46
},
57
"[python]": {
6-
"editor.rulers": [88, 130]
8+
"editor.rulers": [
9+
88,
10+
120
11+
]
712
},
813
"[toml]": {
914
"editor.rulers": [88]

docs/.markdownlint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ no-hard-tabs: true
44
MD007:
55
indent: 2
66
MD013:
7-
line_length: 130
7+
line_length: 120
88
MD031:
99
list_items: false
1010
MD033:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ src = ["src", "tool"]
185185
extend-exclude = [".git", ".mypy_cache", ".tox", ".venv"]
186186
force-exclude = true
187187
# https://typing.python.org/en/latest/guides/writing_stubs.html#maximum-line-length
188-
line-length = 130
188+
line-length = 120
189189
preview = true
190190

191191
[tool.ruff.format]

src/_numtype/.ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
extend = "../../pyproject.toml"
2-
line-length = 130
2+
line-length = 120
33

44
[lint]
55
extend-ignore = [

src/_numtype/__init__.pyi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ MArray = TypeAliasType("MArray", np.ma.MaskedArray[_ShapeT, np.dtype[_ScalarT0]]
185185
MArray0D = TypeAliasType("MArray0D", np.ma.MaskedArray[tuple[()], np.dtype[_ScalarT0]], type_params=(_ScalarT0,))
186186
MArray1D = TypeAliasType("MArray1D", np.ma.MaskedArray[tuple[int], np.dtype[_ScalarT0]], type_params=(_ScalarT0,))
187187
MArray2D = TypeAliasType("MArray2D", np.ma.MaskedArray[tuple[int, int], np.dtype[_ScalarT0]], type_params=(_ScalarT0,))
188-
MArray3D = TypeAliasType("MArray3D", np.ma.MaskedArray[tuple[int, int, int], np.dtype[_ScalarT0]], type_params=(_ScalarT0,))
188+
MArray3D = TypeAliasType(
189+
"MArray3D",
190+
np.ma.MaskedArray[tuple[int, int, int], np.dtype[_ScalarT0]],
191+
type_params=(_ScalarT0,),
192+
)
189193

190194
Matrix = TypeAliasType("Matrix", np.matrix[tuple[int, int], np.dtype[_ScalarT0]], type_params=(_ScalarT0,))
191195

src/_numtype/_nep50.pyi

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ from typing_extensions import TypeAliasType, TypeVar
77

88
import numpy as np
99

10-
__all__ = ["CanCast0D", "CanCastND", "CanNEP50", "CanNEP50Complex", "CanNEP50Float", "MatchND", "PromoteWith", "PromoteWith0D"]
10+
__all__ = [
11+
"CanCast0D",
12+
"CanCastND",
13+
"CanNEP50",
14+
"CanNEP50Complex",
15+
"CanNEP50Float",
16+
"MatchND",
17+
"PromoteWith",
18+
"PromoteWith0D",
19+
]
1120

1221
_T_co = TypeVar("_T_co", covariant=True)
1322
_BelowT_contra = TypeVar("_BelowT_contra", bound=np.generic, contravariant=True)

src/_numtype/_scalar_co.pyi

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import TypeAlias
1+
from typing import Any, TypeAlias
22

33
import numpy as np
44

@@ -37,32 +37,32 @@ __all__ = [
3737
# See https://github.com/numpy/numtype/issues/366 for the scalar promotion table and
3838
# https://numpy.org/neps/nep-0050-scalar-promotion.html for the official specification.
3939

40-
co_integer8: TypeAlias = integer8 | np.bool
41-
co_integer16: TypeAlias = integer16 | co_integer8
42-
co_integer32: TypeAlias = integer32 | co_integer16
43-
co_integer64: TypeAlias = np.integer | np.bool
44-
co_integer = co_integer64
45-
4640
co_int8: TypeAlias = np.int8 | np.bool
4741
co_int16: TypeAlias = np.int16 | co_integer8
4842
co_int32: TypeAlias = np.int32 | co_integer16
4943
co_long: TypeAlias = np.long | co_int32
50-
co_int64: TypeAlias = np.signedinteger | co_integer32
44+
co_int64: TypeAlias = np.signedinteger[Any] | co_integer32
5145

5246
co_uint8: TypeAlias = np.uint8 | np.bool
5347
co_uint16: TypeAlias = np.uint16 | co_uint8
5448
co_uint32: TypeAlias = np.uint32 | co_uint16
5549
co_ulong: TypeAlias = np.ulong | co_uint32
56-
co_uint64: TypeAlias = np.unsignedinteger | np.bool
50+
co_uint64: TypeAlias = np.unsignedinteger[Any] | np.bool
51+
52+
co_integer8: TypeAlias = integer8 | np.bool
53+
co_integer16: TypeAlias = integer16 | co_integer8
54+
co_integer32: TypeAlias = integer32 | co_integer16
55+
co_integer64: TypeAlias = np.integer[Any] | np.bool
56+
co_integer = co_integer64
5757

5858
co_float16: TypeAlias = np.float16 | co_integer8
5959
co_float32: TypeAlias = np.float32 | np.float16 | co_integer16
6060
co_float64: TypeAlias = np.float64 | np.float32 | np.float16 | co_integer64
61-
co_float: TypeAlias = np.floating | co_integer
61+
co_float: TypeAlias = np.floating[Any] | co_integer
6262

6363
co_complex64: TypeAlias = inexact32 | number16 | integer8
6464
co_complex128: TypeAlias = number64 | number32 | number16 | co_integer
65-
co_complex: TypeAlias = np.number | np.bool
65+
co_complex: TypeAlias = np.number[Any] | np.bool
6666
co_number = co_complex
6767

6868
co_timedelta: TypeAlias = np.timedelta64 | co_integer

src/numpy-stubs/.ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
extend = "../../pyproject.toml"
2-
line-length = 130
2+
line-length = 120
33

44
[lint]
55
extend-ignore = [

src/numpy-stubs/@test/generated/.ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
extend = "../.ruff.toml"
2-
line-length = 130
2+
line-length = 120
33

44
[lint]
55
extend-ignore = [

src/numpy-stubs/@test/static/.ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
extend = "../.ruff.toml"
2-
line-length = 130
2+
line-length = 120
33

44
[lint]
55
extend-ignore = [

0 commit comments

Comments
 (0)