Skip to content

Commit ad3de65

Browse files
committed
⏪ revert the system-dependent extended-precision changes
1 parent fc6fb74 commit ad3de65

File tree

8 files changed

+102
-121
lines changed

8 files changed

+102
-121
lines changed

src/numpy-stubs/__init__.pyi

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -519,12 +519,12 @@ __all__ = [ # noqa: RUF022
519519
"bitwise_and", "bitwise_count", "bitwise_invert", "bitwise_left_shift", "bitwise_not", "bitwise_or",
520520
"bitwise_right_shift", "bitwise_xor", "block", "bool", "bool_", "broadcast", "busday_count", "busday_offset",
521521
"busdaycalendar", "byte", "bytes_", "can_cast", "cbrt", "cdouble", "ceil", "character", "choose", "clip",
522-
"clongdouble", "complex128", "complex64", "complexfloating", "compress", "concat",
522+
"clongdouble", "complex64", "complex128", "complex192", "complex256", "complexfloating", "compress", "concat",
523523
"concatenate", "conj", "conjugate", "convolve", "copysign", "copyto", "correlate", "cos", "cosh", "count_nonzero",
524524
"cross", "csingle", "cumprod", "cumsum", "cumulative_prod", "cumulative_sum", "datetime64", "datetime_as_string",
525525
"datetime_data", "deg2rad", "degrees", "diagonal", "divide", "divmod", "dot", "double", "dtype", "e", "einsum",
526526
"einsum_path", "empty", "empty_like", "equal", "errstate", "euler_gamma", "exp", "exp2", "expm1", "fabs", "finfo",
527-
"flatiter", "flatnonzero", "flexible", "float16", "float32", "float64", "float_power",
527+
"flatiter", "flatnonzero", "flexible", "float16", "float32", "float64", "float96", "float128", "float_power",
528528
"floating", "floor", "floor_divide", "fmax", "fmin", "fmod", "format_float_positional", "format_float_scientific",
529529
"frexp", "from_dlpack", "frombuffer", "fromfile", "fromfunction", "fromiter", "frompyfunc", "fromstring", "full",
530530
"full_like", "gcd", "generic", "geomspace", "get_printoptions", "getbufsize", "geterr", "geterrcall", "greater",
@@ -595,11 +595,6 @@ __all__ = [ # noqa: RUF022
595595
"__version__",
596596
] # fmt: skip
597597

598-
if sys.platform == "win32" or sys.platform == "cygwin":
599-
__all__ += ["complex192", "float96"]
600-
else:
601-
__all__ += ["complex256", "float128"]
602-
603598
###
604599
# Constrained types (for internal use only)
605600

@@ -4703,10 +4698,8 @@ class longdouble(_FloatMixin[L[12, 16]], floating):
47034698
@override
47044699
def tolist(self, /) -> Self: ... # pyright: ignore[reportIncompatibleMethodOverride]
47054700

4706-
if sys.platform == "win32" or sys.platform == "cygwin":
4707-
float96 = longdouble
4708-
else:
4709-
float128 = longdouble
4701+
float96 = longdouble
4702+
float128 = longdouble
47104703

47114704
class complexfloating(inexact[complex]):
47124705
@override
@@ -4893,10 +4886,8 @@ class clongdouble(complexfloating):
48934886
#
48944887
def __complex__(self, /) -> complex: ...
48954888

4896-
if sys.platform == "win32" or sys.platform == "cygwin":
4897-
complex192 = clongdouble
4898-
else:
4899-
complex256 = clongdouble
4889+
complex192 = clongdouble
4890+
complex256 = clongdouble
49004891

49014892
# NOTE: The `object_` constructor returns the passed object, so instances with type `object_` cannot exists at runtime.
49024893
# NOTE: Because mypy does not fully support `__new__`, `object_` can't be made generic.

src/numpy-stubs/_core/__init__.pyi

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import sys
2-
31
from ._asarray import require
42
from ._ufunc_config import errstate, getbufsize, geterr, geterrcall, setbufsize, seterr, seterrcall
53
from .arrayprint import (
@@ -152,6 +150,8 @@ from .numerictypes import (
152150
clongdouble,
153151
complex64,
154152
complex128,
153+
complex192,
154+
complex256,
155155
complexfloating,
156156
csingle,
157157
datetime64,
@@ -162,6 +162,8 @@ from .numerictypes import (
162162
float16,
163163
float32,
164164
float64,
165+
float96,
166+
float128,
165167
floating,
166168
generic,
167169
half,
@@ -391,6 +393,8 @@ __all__ = [
391393
"clongdouble",
392394
"complex64",
393395
"complex128",
396+
"complex192",
397+
"complex256",
394398
"complexfloating",
395399
"compress",
396400
"concat",
@@ -440,6 +444,8 @@ __all__ = [
440444
"float16",
441445
"float32",
442446
"float64",
447+
"float96",
448+
"float128",
443449
"float_power",
444450
"floating",
445451
"floor",
@@ -639,12 +645,3 @@ __all__ = [
639645
"zeros",
640646
"zeros_like",
641647
]
642-
643-
if sys.platform == "win32" or sys.platform == "cygwin":
644-
from .numerictypes import complex192, float96
645-
646-
__all__ += ["complex192", "float96"]
647-
else:
648-
from .numerictypes import complex256, float128
649-
650-
__all__ += ["complex256", "float128"]

src/numpy-stubs/_core/numeric.pyi

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
from builtins import bool as py_bool
32
from collections.abc import Callable, Sequence
43
from typing import (
@@ -140,6 +139,8 @@ from .numerictypes import (
140139
clongdouble,
141140
complex64,
142141
complex128,
142+
complex192,
143+
complex256,
143144
complexfloating,
144145
csingle,
145146
datetime64,
@@ -150,6 +151,8 @@ from .numerictypes import (
150151
float16,
151152
float32,
152153
float64,
154+
float96,
155+
float128,
153156
floating,
154157
generic,
155158
half,
@@ -350,6 +353,8 @@ __all__ = [
350353
"clongdouble",
351354
"complex64",
352355
"complex128",
356+
"complex192",
357+
"complex256",
353358
"complexfloating",
354359
"compress",
355360
"concatenate",
@@ -395,6 +400,8 @@ __all__ = [
395400
"float16",
396401
"float32",
397402
"float64",
403+
"float96",
404+
"float128",
398405
"float_power",
399406
"floating",
400407
"floor",
@@ -582,15 +589,6 @@ __all__ = [
582589
"zeros_like",
583590
]
584591

585-
if sys.platform == "win32" or sys.platform == "cygwin":
586-
from .numerictypes import complex192, float96
587-
588-
__all__ += ["complex192", "float96"]
589-
else:
590-
from .numerictypes import complex256, float128
591-
592-
__all__ += ["complex256", "float128"]
593-
594592
###
595593

596594
_T = TypeVar("_T")

src/numpy-stubs/_core/numerictypes.pyi

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
from builtins import bool as py_bool
32
from typing import Final, Literal as L, TypedDict, type_check_only
43

@@ -15,6 +14,8 @@ from numpy import (
1514
clongdouble,
1615
complex64,
1716
complex128,
17+
complex192,
18+
complex256,
1819
complexfloating,
1920
csingle,
2021
datetime64,
@@ -24,6 +25,8 @@ from numpy import (
2425
float16,
2526
float32,
2627
float64,
28+
float96,
29+
float128,
2730
floating,
2831
generic,
2932
half,
@@ -79,6 +82,8 @@ __all__ = [
7982
"clongdouble",
8083
"complex64",
8184
"complex128",
85+
"complex192",
86+
"complex256",
8287
"complexfloating",
8388
"csingle",
8489
"datetime64",
@@ -89,6 +94,8 @@ __all__ = [
8994
"float16",
9095
"float32",
9196
"float64",
97+
"float96",
98+
"float128",
9299
"floating",
93100
"generic",
94101
"half",
@@ -130,15 +137,6 @@ __all__ = [
130137
"void",
131138
]
132139

133-
if sys.platform == "win32" or sys.platform == "cygwin":
134-
from numpy import complex192, float96
135-
136-
__all__ += ["complex192", "float96"]
137-
else:
138-
from numpy import complex256, float128
139-
140-
__all__ += ["complex256", "float128"]
141-
142140
###
143141

144142
@type_check_only

src/numpy-stubs/core/numeric.pyi

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import sys
2-
31
from numpy._core.numeric import (
42
False_,
53
ScalarType,
@@ -61,6 +59,8 @@ from numpy._core.numeric import (
6159
clongdouble,
6260
complex64,
6361
complex128,
62+
complex192,
63+
complex256,
6464
complexfloating,
6565
compress,
6666
concatenate,
@@ -106,6 +106,8 @@ from numpy._core.numeric import (
106106
float16,
107107
float32,
108108
float64,
109+
float96,
110+
float128,
109111
float_power,
110112
floating,
111113
floor,
@@ -353,6 +355,8 @@ __all__ = [
353355
"clongdouble",
354356
"complex64",
355357
"complex128",
358+
"complex192",
359+
"complex256",
356360
"complexfloating",
357361
"compress",
358362
"concatenate",
@@ -398,6 +402,8 @@ __all__ = [
398402
"float16",
399403
"float32",
400404
"float64",
405+
"float96",
406+
"float128",
401407
"float_power",
402408
"floating",
403409
"floor",
@@ -584,12 +590,3 @@ __all__ = [
584590
"zeros",
585591
"zeros_like",
586592
]
587-
588-
if sys.platform == "win32" or sys.platform == "cygwin":
589-
from numpy._core.numeric import complex192, float96
590-
591-
__all__ += ["complex192", "float96"]
592-
else:
593-
from numpy._core.numeric import complex256, float128
594-
595-
__all__ += ["complex256", "float128"]

0 commit comments

Comments
 (0)