types-array-api 1.2.0__tar.gz → 1.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {types_array_api-1.2.0/src/types_array_api.egg-info → types_array_api-1.3.0}/PKG-INFO +13 -14
- {types_array_api-1.2.0 → types_array_api-1.3.0}/README.md +8 -8
- {types_array_api-1.2.0 → types_array_api-1.3.0}/pyproject.toml +42 -60
- {types_array_api-1.2.0 → types_array_api-1.3.0}/src/array_api/_2022_12.py +42 -42
- {types_array_api-1.2.0 → types_array_api-1.3.0}/src/array_api/_2023_12.py +42 -42
- {types_array_api-1.2.0 → types_array_api-1.3.0}/src/array_api/_2024_12.py +42 -42
- types_array_api-1.3.0/src/array_api/_2025_12.py +9647 -0
- types_array_api-1.3.0/src/array_api/__init__.py +1 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/src/array_api/_draft.py +290 -72
- {types_array_api-1.2.0 → types_array_api-1.3.0}/src/array_api/cli/_main.py +3 -2
- types_array_api-1.3.0/src/array_api/latest.py +1 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0/src/types_array_api.egg-info}/PKG-INFO +13 -14
- {types_array_api-1.2.0 → types_array_api-1.3.0}/src/types_array_api.egg-info/SOURCES.txt +1 -0
- types_array_api-1.3.0/src/types_array_api.egg-info/requires.txt +6 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/tests/test_main.py +18 -5
- types_array_api-1.2.0/src/array_api/__init__.py +0 -1
- types_array_api-1.2.0/src/array_api/latest.py +0 -1
- types_array_api-1.2.0/src/types_array_api.egg-info/requires.txt +0 -6
- {types_array_api-1.2.0 → types_array_api-1.3.0}/LICENSE +0 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/LICENSE-MIT +0 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/setup.cfg +0 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/setup.py +0 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/src/array_api/__main__.py +0 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/src/array_api/cli/__init__.py +0 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/src/array_api/cli/cli.py +0 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/src/array_api/py.typed +0 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/src/array_api_compat/__init__.pyi +0 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/src/types_array_api.egg-info/dependency_links.txt +0 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/src/types_array_api.egg-info/entry_points.txt +0 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/src/types_array_api.egg-info/top_level.txt +0 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/tests/test_cli.py +0 -0
- {types_array_api-1.2.0 → types_array_api-1.3.0}/tests/test_dunder_main.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: types-array-api
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary: Typing for array API and array-api-compat
|
|
5
5
|
Author-email: 34j <34j.95a2p@simplelogin.com>
|
|
6
6
|
License-Expression: MIT AND Apache-2.0
|
|
@@ -12,19 +12,18 @@ Classifier: Development Status :: 2 - Pre-Alpha
|
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
13
13
|
Classifier: Natural Language :: English
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
|
-
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
19
|
Classifier: Topic :: Software Development :: Libraries
|
|
21
20
|
Requires-Python: >=3.12
|
|
22
21
|
Description-Content-Type: text/markdown
|
|
23
22
|
License-File: LICENSE
|
|
24
23
|
License-File: LICENSE-MIT
|
|
25
|
-
Requires-Dist: typing-extensions>=4.14
|
|
24
|
+
Requires-Dist: typing-extensions>=4.14
|
|
26
25
|
Provides-Extra: cli
|
|
27
|
-
Requires-Dist: attrs>=25.3
|
|
26
|
+
Requires-Dist: attrs>=25.3; extra == "cli"
|
|
28
27
|
Requires-Dist: rich>=14; extra == "cli"
|
|
29
28
|
Requires-Dist: typer>=0.16; extra == "cli"
|
|
30
29
|
Dynamic: license-file
|
|
@@ -33,13 +32,13 @@ Dynamic: license-file
|
|
|
33
32
|
|
|
34
33
|
<p align="center">
|
|
35
34
|
<a href="https://github.com/34j/types-array-api/actions/workflows/ci.yml?query=branch%3Amain">
|
|
36
|
-
<img src="https://img.shields.io/github/actions/workflow/status/34j/array-api/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
|
|
35
|
+
<img src="https://img.shields.io/github/actions/workflow/status/34j/types-array-api/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
|
|
37
36
|
</a>
|
|
38
37
|
<a href="https://array-api.readthedocs.io">
|
|
39
|
-
<img src="https://img.shields.io/readthedocs/array-api.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
|
|
38
|
+
<img src="https://img.shields.io/readthedocs/types-array-api.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
|
|
40
39
|
</a>
|
|
41
|
-
<a href="https://codecov.io/gh/34j/array-api">
|
|
42
|
-
<img src="https://img.shields.io/codecov/c/github/34j/array-api.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
|
|
40
|
+
<a href="https://codecov.io/gh/34j/types-array-api">
|
|
41
|
+
<img src="https://img.shields.io/codecov/c/github/34j/types-array-api.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
|
|
43
42
|
</a>
|
|
44
43
|
</p>
|
|
45
44
|
<p align="center">
|
|
@@ -54,11 +53,11 @@ Dynamic: license-file
|
|
|
54
53
|
</a>
|
|
55
54
|
</p>
|
|
56
55
|
<p align="center">
|
|
57
|
-
<a href="https://pypi.org/project/array-api/">
|
|
58
|
-
<img src="https://img.shields.io/pypi/v/array-api.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
|
|
56
|
+
<a href="https://pypi.org/project/types-array-api/">
|
|
57
|
+
<img src="https://img.shields.io/pypi/v/types-array-api.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
|
|
59
58
|
</a>
|
|
60
|
-
<img src="https://img.shields.io/pypi/pyversions/array-api.svg?style=flat-square&logo=python&logoColor=fff" alt="Supported Python versions">
|
|
61
|
-
<img src="https://img.shields.io/pypi/l/array-api.svg?style=flat-square" alt="License">
|
|
59
|
+
<img src="https://img.shields.io/pypi/pyversions/types-array-api.svg?style=flat-square&logo=python&logoColor=fff" alt="Supported Python versions">
|
|
60
|
+
<img src="https://img.shields.io/pypi/l/types-array-api.svg?style=flat-square" alt="License">
|
|
62
61
|
</p>
|
|
63
62
|
|
|
64
63
|
---
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<a href="https://github.com/34j/types-array-api/actions/workflows/ci.yml?query=branch%3Amain">
|
|
5
|
-
<img src="https://img.shields.io/github/actions/workflow/status/34j/array-api/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
|
|
5
|
+
<img src="https://img.shields.io/github/actions/workflow/status/34j/types-array-api/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
|
|
6
6
|
</a>
|
|
7
7
|
<a href="https://array-api.readthedocs.io">
|
|
8
|
-
<img src="https://img.shields.io/readthedocs/array-api.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
|
|
8
|
+
<img src="https://img.shields.io/readthedocs/types-array-api.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
|
|
9
9
|
</a>
|
|
10
|
-
<a href="https://codecov.io/gh/34j/array-api">
|
|
11
|
-
<img src="https://img.shields.io/codecov/c/github/34j/array-api.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
|
|
10
|
+
<a href="https://codecov.io/gh/34j/types-array-api">
|
|
11
|
+
<img src="https://img.shields.io/codecov/c/github/34j/types-array-api.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
|
|
12
12
|
</a>
|
|
13
13
|
</p>
|
|
14
14
|
<p align="center">
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
</a>
|
|
24
24
|
</p>
|
|
25
25
|
<p align="center">
|
|
26
|
-
<a href="https://pypi.org/project/array-api/">
|
|
27
|
-
<img src="https://img.shields.io/pypi/v/array-api.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
|
|
26
|
+
<a href="https://pypi.org/project/types-array-api/">
|
|
27
|
+
<img src="https://img.shields.io/pypi/v/types-array-api.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
|
|
28
28
|
</a>
|
|
29
|
-
<img src="https://img.shields.io/pypi/pyversions/array-api.svg?style=flat-square&logo=python&logoColor=fff" alt="Supported Python versions">
|
|
30
|
-
<img src="https://img.shields.io/pypi/l/array-api.svg?style=flat-square" alt="License">
|
|
29
|
+
<img src="https://img.shields.io/pypi/pyversions/types-array-api.svg?style=flat-square&logo=python&logoColor=fff" alt="Supported Python versions">
|
|
30
|
+
<img src="https://img.shields.io/pypi/l/types-array-api.svg?style=flat-square" alt="License">
|
|
31
31
|
</p>
|
|
32
32
|
|
|
33
33
|
---
|
|
@@ -4,7 +4,7 @@ requires = [ "setuptools" ]
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "types-array-api"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.3.0"
|
|
8
8
|
description = "Typing for array API and array-api-compat"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT AND Apache-2.0"
|
|
@@ -17,19 +17,17 @@ classifiers = [
|
|
|
17
17
|
"Intended Audience :: Developers",
|
|
18
18
|
"Natural Language :: English",
|
|
19
19
|
"Operating System :: OS Independent",
|
|
20
|
-
"Programming Language :: Python :: 3
|
|
21
|
-
"Programming Language :: Python :: 3.10",
|
|
22
|
-
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
23
21
|
"Programming Language :: Python :: 3.12",
|
|
24
22
|
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Programming Language :: Python :: 3.14",
|
|
25
24
|
"Topic :: Software Development :: Libraries",
|
|
26
25
|
]
|
|
27
|
-
|
|
28
26
|
dependencies = [
|
|
29
|
-
"typing-extensions>=4.14
|
|
27
|
+
"typing-extensions>=4.14",
|
|
30
28
|
]
|
|
31
29
|
optional-dependencies.cli = [
|
|
32
|
-
"attrs>=25.3
|
|
30
|
+
"attrs>=25.3",
|
|
33
31
|
"rich>=14",
|
|
34
32
|
"typer>=0.16",
|
|
35
33
|
]
|
|
@@ -44,12 +42,12 @@ scripts.types-array-api = "array_api.cli:app"
|
|
|
44
42
|
dev = [
|
|
45
43
|
"array-api-compat>=1.11.2",
|
|
46
44
|
"array-api-strict>=2.3.1",
|
|
47
|
-
"attrs>=25.3
|
|
45
|
+
"attrs>=25.3",
|
|
48
46
|
"pytest>=9,<10",
|
|
49
47
|
"pytest-cov>=7,<8",
|
|
50
|
-
"rich>=14
|
|
48
|
+
"rich>=14",
|
|
51
49
|
"ruff>=0.11.13",
|
|
52
|
-
"typer>=0.16
|
|
50
|
+
"typer>=0.16",
|
|
53
51
|
]
|
|
54
52
|
docs = [
|
|
55
53
|
"furo>=2023.5.20; python_version>='3.11'",
|
|
@@ -62,26 +60,27 @@ docs = [
|
|
|
62
60
|
line-length = 320
|
|
63
61
|
lint.select = [
|
|
64
62
|
"B", # flake8-bugbear
|
|
65
|
-
"D", # flake8-docstrings
|
|
66
63
|
"C4", # flake8-comprehensions
|
|
67
|
-
"
|
|
68
|
-
"F", # pyflake
|
|
64
|
+
"D", # flake8-docstrings
|
|
69
65
|
"E", # pycodestyle
|
|
70
|
-
"
|
|
71
|
-
"UP", # pyupgrade
|
|
66
|
+
"F", # pyflake
|
|
72
67
|
"I", # isort
|
|
73
68
|
"RUF", # ruff specific
|
|
69
|
+
"S", # flake8-bandit
|
|
70
|
+
"UP", # pyupgrade
|
|
71
|
+
"W", # pycodestyle
|
|
74
72
|
]
|
|
75
73
|
lint.ignore = [
|
|
76
|
-
"D203", # 1 blank line required before class docstring
|
|
77
|
-
"D212", # Multi-line docstring summary should start at the first line
|
|
78
74
|
"D100", # Missing docstring in public module
|
|
79
75
|
"D104", # Missing docstring in public package
|
|
80
76
|
"D107", # Missing docstring in `__init__`
|
|
77
|
+
"D203", # 1 blank line required before class docstring
|
|
78
|
+
"D212", # Multi-line docstring summary should start at the first line
|
|
79
|
+
"D301", # Use r""" if any backslashes in a docstring
|
|
81
80
|
"D401", # First line of docstring should be in imperative mood
|
|
81
|
+
"E501",
|
|
82
82
|
"S603",
|
|
83
|
-
"S607"
|
|
84
|
-
"E501"
|
|
83
|
+
"S607"
|
|
85
84
|
]
|
|
86
85
|
lint.per-file-ignores."conftest.py" = [ "D100" ]
|
|
87
86
|
lint.per-file-ignores."docs/conf.py" = [ "D100" ]
|
|
@@ -96,26 +95,24 @@ lint.per-file-ignores."tests/**/*" = [
|
|
|
96
95
|
]
|
|
97
96
|
lint.isort.known-first-party = [ "array_api", "tests" ]
|
|
98
97
|
|
|
99
|
-
[tool.pytest
|
|
100
|
-
addopts = """\
|
|
98
|
+
[tool.pytest]
|
|
99
|
+
ini_options.addopts = """\
|
|
101
100
|
-v
|
|
102
101
|
-Wdefault
|
|
103
102
|
--cov=array_api
|
|
104
103
|
--cov-report=term
|
|
105
104
|
--cov-report=xml
|
|
106
105
|
"""
|
|
107
|
-
pythonpath = [ "src" ]
|
|
108
|
-
|
|
109
|
-
[tool.coverage.run]
|
|
110
|
-
branch = true
|
|
106
|
+
ini_options.pythonpath = [ "src" ]
|
|
111
107
|
|
|
112
|
-
[tool.coverage
|
|
113
|
-
|
|
114
|
-
|
|
108
|
+
[tool.coverage]
|
|
109
|
+
run.branch = true
|
|
110
|
+
report.exclude_lines = [
|
|
115
111
|
"@overload",
|
|
112
|
+
'if __name__ == "__main__":',
|
|
116
113
|
"if TYPE_CHECKING",
|
|
114
|
+
"pragma: no cover",
|
|
117
115
|
"raise NotImplementedError",
|
|
118
|
-
'if __name__ == "__main__":',
|
|
119
116
|
]
|
|
120
117
|
|
|
121
118
|
[tool.mypy]
|
|
@@ -129,17 +126,10 @@ show_error_codes = true
|
|
|
129
126
|
warn_unreachable = true
|
|
130
127
|
warn_unused_ignores = true
|
|
131
128
|
exclude = [
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
"docs/.*",
|
|
130
|
+
"setup.py",
|
|
134
131
|
]
|
|
135
|
-
|
|
136
|
-
[[tool.mypy.overrides]]
|
|
137
|
-
module = "tests.*"
|
|
138
|
-
allow_untyped_defs = true
|
|
139
|
-
|
|
140
|
-
[[tool.mypy.overrides]]
|
|
141
|
-
module = "docs.*"
|
|
142
|
-
ignore_errors = true
|
|
132
|
+
overrides = [ { module = "tests.*", allow_untyped_defs = true }, { module = "docs.*", ignore_errors = true } ]
|
|
143
133
|
|
|
144
134
|
[tool.semantic_release]
|
|
145
135
|
version_toml = [ "pyproject.toml:project.version" ]
|
|
@@ -153,25 +143,17 @@ uv lock
|
|
|
153
143
|
git add uv.lock
|
|
154
144
|
uv build
|
|
155
145
|
"""
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
146
|
+
branches.main.match = "main"
|
|
147
|
+
branches.noop.match = "(?!main$)"
|
|
148
|
+
branches.noop.prerelease = true
|
|
149
|
+
changelog.exclude_commit_patterns = [
|
|
150
|
+
"chore(?:\\([^)]*?\\))?: .+",
|
|
151
|
+
"ci(?:\\([^)]*?\\))?: .+",
|
|
152
|
+
"refactor(?:\\([^)]*?\\))?: .+",
|
|
153
|
+
"style(?:\\([^)]*?\\))?: .+",
|
|
154
|
+
"test(?:\\([^)]*?\\))?: .+",
|
|
155
|
+
"build\\((?!deps\\): .+)",
|
|
156
|
+
"Merged? .*",
|
|
157
|
+
"Initial [Cc]ommit.*", # codespell:ignore
|
|
167
158
|
]
|
|
168
|
-
|
|
169
|
-
[tool.semantic_release.changelog.environment]
|
|
170
|
-
keep_trailing_newline = true
|
|
171
|
-
|
|
172
|
-
[tool.semantic_release.branches.main]
|
|
173
|
-
match = "main"
|
|
174
|
-
|
|
175
|
-
[tool.semantic_release.branches.noop]
|
|
176
|
-
match = "(?!main$)"
|
|
177
|
-
prerelease = true
|
|
159
|
+
changelog.environment.keep_trailing_newline = true
|
|
@@ -2099,7 +2099,7 @@ class arange[TArray: Array, TDtype, TDevice](Protocol):
|
|
|
2099
2099
|
|
|
2100
2100
|
@runtime_checkable
|
|
2101
2101
|
class asarray[TArray: Array, TDtype, TDevice](Protocol):
|
|
2102
|
-
|
|
2102
|
+
"""
|
|
2103
2103
|
Convert the input to an array.
|
|
2104
2104
|
|
|
2105
2105
|
Parameters
|
|
@@ -2204,7 +2204,7 @@ class empty_like[TArray: Array, TDtype, TDevice](Protocol):
|
|
|
2204
2204
|
|
|
2205
2205
|
@runtime_checkable
|
|
2206
2206
|
class eye[TArray: Array, TDtype, TDevice](Protocol):
|
|
2207
|
-
|
|
2207
|
+
"""
|
|
2208
2208
|
Returns a two-dimensional array with ones on the ``k``\\th diagonal and zeros elsewhere.
|
|
2209
2209
|
|
|
2210
2210
|
.. note::
|
|
@@ -2350,7 +2350,7 @@ class full_like[TArray: Array, TDtype, TDevice](Protocol):
|
|
|
2350
2350
|
|
|
2351
2351
|
@runtime_checkable
|
|
2352
2352
|
class linspace[TArray: Array, TDtype, TDevice](Protocol):
|
|
2353
|
-
|
|
2353
|
+
"""
|
|
2354
2354
|
Returns evenly spaced numbers over a specified interval.
|
|
2355
2355
|
|
|
2356
2356
|
Let :math:`N` be the number of generated values (which is either ``num`` or ``num+1`` depending on whether ``endpoint`` is ``True`` or ``False``, respectively). For real-valued output arrays, the spacing between values is given by
|
|
@@ -2632,7 +2632,7 @@ class zeros_like[TArray: Array, TDtype, TDevice](Protocol):
|
|
|
2632
2632
|
|
|
2633
2633
|
@runtime_checkable
|
|
2634
2634
|
class cholesky[TArray: Array](Protocol):
|
|
2635
|
-
|
|
2635
|
+
"""
|
|
2636
2636
|
Returns the lower (upper) Cholesky decomposition of a complex Hermitian or real symmetric positive-definite matrix ``x``.
|
|
2637
2637
|
|
|
2638
2638
|
If ``x`` is real-valued, let :math:`\\mathbb{K}` be the set of real numbers :math:`\\mathbb{R}`, and, if ``x`` is complex-valued, let :math:`\\mathbb{K}` be the set of complex numbers :math:`\\mathbb{C}`.
|
|
@@ -2784,7 +2784,7 @@ class diagonal[TArray: Array](Protocol):
|
|
|
2784
2784
|
|
|
2785
2785
|
@runtime_checkable
|
|
2786
2786
|
class eigh[TArray: Array](Protocol):
|
|
2787
|
-
|
|
2787
|
+
"""
|
|
2788
2788
|
Returns an eigenvalue decomposition of a complex Hermitian or real symmetric matrix (or a stack of matrices) ``x``.
|
|
2789
2789
|
|
|
2790
2790
|
If ``x`` is real-valued, let :math:`\\mathbb{K}` be the set of real numbers :math:`\\mathbb{R}`, and, if ``x`` is complex-valued, let :math:`\\mathbb{K}` be the set of complex numbers :math:`\\mathbb{C}`.
|
|
@@ -2840,7 +2840,7 @@ class eigh[TArray: Array](Protocol):
|
|
|
2840
2840
|
|
|
2841
2841
|
@runtime_checkable
|
|
2842
2842
|
class eigvalsh[TArray: Array](Protocol):
|
|
2843
|
-
|
|
2843
|
+
"""
|
|
2844
2844
|
Returns the eigenvalues of a complex Hermitian or real symmetric matrix (or a stack of matrices) ``x``.
|
|
2845
2845
|
|
|
2846
2846
|
If ``x`` is real-valued, let :math:`\\mathbb{K}` be the set of real numbers :math:`\\mathbb{R}`, and, if ``x`` is complex-valued, let :math:`\\mathbb{K}` be the set of complex numbers :math:`\\mathbb{C}`.
|
|
@@ -2888,7 +2888,7 @@ class eigvalsh[TArray: Array](Protocol):
|
|
|
2888
2888
|
|
|
2889
2889
|
@runtime_checkable
|
|
2890
2890
|
class inv[TArray: Array](Protocol):
|
|
2891
|
-
|
|
2891
|
+
"""
|
|
2892
2892
|
Returns the multiplicative inverse of a square matrix (or a stack of square matrices) ``x``.
|
|
2893
2893
|
|
|
2894
2894
|
If ``x`` is real-valued, let :math:`\\mathbb{K}` be the set of real numbers :math:`\\mathbb{R}`, and, if ``x`` is complex-valued, let :math:`\\mathbb{K}` be the set of complex numbers :math:`\\mathbb{C}`.
|
|
@@ -3083,7 +3083,7 @@ class outer[TArray: Array](Protocol):
|
|
|
3083
3083
|
|
|
3084
3084
|
@runtime_checkable
|
|
3085
3085
|
class pinv[TArray: Array](Protocol):
|
|
3086
|
-
|
|
3086
|
+
"""
|
|
3087
3087
|
Returns the (Moore-Penrose) pseudo-inverse of a matrix (or a stack of matrices) ``x``.
|
|
3088
3088
|
|
|
3089
3089
|
The pseudo-inverse of a matrix :math:`A`, denoted :math:`A^{+}`, is defined as the matrix that "solves" the least-squares problem :math:`Ax = b` (i.e., if :math:`\\overline{x}` is a solution, then :math:`A^{+}` is the matrix such that :math:`\\overline{x} = A^{+}b`).
|
|
@@ -3128,7 +3128,7 @@ class pinv[TArray: Array](Protocol):
|
|
|
3128
3128
|
|
|
3129
3129
|
@runtime_checkable
|
|
3130
3130
|
class qr[TArray: Array](Protocol):
|
|
3131
|
-
|
|
3131
|
+
"""
|
|
3132
3132
|
Returns the QR decomposition of a full column rank matrix (or a stack of matrices).
|
|
3133
3133
|
|
|
3134
3134
|
If ``x`` is real-valued, let :math:`\\mathbb{K}` be the set of real numbers :math:`\\mathbb{R}`, and, if ``x`` is complex-valued, let :math:`\\mathbb{K}` be the set of complex numbers :math:`\\mathbb{C}`.
|
|
@@ -3196,7 +3196,7 @@ class qr[TArray: Array](Protocol):
|
|
|
3196
3196
|
|
|
3197
3197
|
@runtime_checkable
|
|
3198
3198
|
class slogdet[TArray: Array](Protocol):
|
|
3199
|
-
|
|
3199
|
+
"""
|
|
3200
3200
|
Returns the sign and the natural logarithm of the absolute value of the determinant of a square matrix (or a stack of square matrices) ``x``.
|
|
3201
3201
|
|
|
3202
3202
|
.. note::
|
|
@@ -3256,7 +3256,7 @@ class slogdet[TArray: Array](Protocol):
|
|
|
3256
3256
|
|
|
3257
3257
|
@runtime_checkable
|
|
3258
3258
|
class solve[TArray: Array](Protocol):
|
|
3259
|
-
|
|
3259
|
+
"""
|
|
3260
3260
|
Returns the solution of a square system of linear equations with a unique solution.
|
|
3261
3261
|
|
|
3262
3262
|
Let ``x1`` equal :math:`A` and ``x2`` equal :math:`B`. If the promoted data type of ``x1`` and ``x2`` is real-valued, let :math:`\\mathbb{K}` be the set of real numbers :math:`\\mathbb{R}`, and, if the promoted data type of ``x1`` and ``x2`` is complex-valued, let :math:`\\mathbb{K}` be the set of complex numbers :math:`\\mathbb{C}`.
|
|
@@ -3299,7 +3299,7 @@ class solve[TArray: Array](Protocol):
|
|
|
3299
3299
|
|
|
3300
3300
|
@runtime_checkable
|
|
3301
3301
|
class svd[TArray: Array](Protocol):
|
|
3302
|
-
|
|
3302
|
+
"""
|
|
3303
3303
|
Returns a singular value decomposition (SVD) of a matrix (or a stack of matrices) ``x``.
|
|
3304
3304
|
|
|
3305
3305
|
If ``x`` is real-valued, let :math:`\\mathbb{K}` be the set of real numbers :math:`\\mathbb{R}`, and, if ``x`` is complex-valued, let :math:`\\mathbb{K}` be the set of complex numbers :math:`\\mathbb{C}`.
|
|
@@ -3449,7 +3449,7 @@ class trace[TArray: Array, TDtype](Protocol):
|
|
|
3449
3449
|
|
|
3450
3450
|
@runtime_checkable
|
|
3451
3451
|
class vector_norm[TArray: Array](Protocol):
|
|
3452
|
-
|
|
3452
|
+
"""
|
|
3453
3453
|
Computes the vector norm of a vector (or batch of vectors) ``x``.
|
|
3454
3454
|
|
|
3455
3455
|
Parameters
|
|
@@ -3573,7 +3573,7 @@ class sort[TArray: Array](Protocol):
|
|
|
3573
3573
|
|
|
3574
3574
|
@runtime_checkable
|
|
3575
3575
|
class abs[TArray: Array](Protocol):
|
|
3576
|
-
|
|
3576
|
+
"""
|
|
3577
3577
|
Calculates the absolute value for each element ``x_i`` of the input array ``x``.
|
|
3578
3578
|
|
|
3579
3579
|
For real-valued input arrays, the element-wise result has the same magnitude as the respective element in ``x`` but has positive sign.
|
|
@@ -3634,7 +3634,7 @@ class abs[TArray: Array](Protocol):
|
|
|
3634
3634
|
|
|
3635
3635
|
@runtime_checkable
|
|
3636
3636
|
class acos[TArray: Array](Protocol):
|
|
3637
|
-
|
|
3637
|
+
"""
|
|
3638
3638
|
Calculates an implementation-dependent approximation of the principal value of the inverse cosine for each element ``x_i`` of the input array ``x``.
|
|
3639
3639
|
|
|
3640
3640
|
Each element-wise result is expressed in radians.
|
|
@@ -3707,7 +3707,7 @@ class acos[TArray: Array](Protocol):
|
|
|
3707
3707
|
|
|
3708
3708
|
@runtime_checkable
|
|
3709
3709
|
class acosh[TArray: Array](Protocol):
|
|
3710
|
-
|
|
3710
|
+
"""
|
|
3711
3711
|
Calculates an implementation-dependent approximation to the inverse hyperbolic cosine for each element ``x_i`` of the input array ``x``.
|
|
3712
3712
|
|
|
3713
3713
|
.. note::
|
|
@@ -3857,7 +3857,7 @@ class add[TArray: Array](Protocol):
|
|
|
3857
3857
|
|
|
3858
3858
|
@runtime_checkable
|
|
3859
3859
|
class asin[TArray: Array](Protocol):
|
|
3860
|
-
|
|
3860
|
+
"""
|
|
3861
3861
|
Calculates an implementation-dependent approximation of the principal value of the inverse sine for each element ``x_i`` of the input array ``x``.
|
|
3862
3862
|
|
|
3863
3863
|
Each element-wise result is expressed in radians.
|
|
@@ -3918,7 +3918,7 @@ class asin[TArray: Array](Protocol):
|
|
|
3918
3918
|
|
|
3919
3919
|
@runtime_checkable
|
|
3920
3920
|
class asinh[TArray: Array](Protocol):
|
|
3921
|
-
|
|
3921
|
+
"""
|
|
3922
3922
|
Calculates an implementation-dependent approximation to the inverse hyperbolic sine for each element ``x_i`` in the input array ``x``.
|
|
3923
3923
|
|
|
3924
3924
|
.. note::
|
|
@@ -3987,7 +3987,7 @@ class asinh[TArray: Array](Protocol):
|
|
|
3987
3987
|
|
|
3988
3988
|
@runtime_checkable
|
|
3989
3989
|
class atan[TArray: Array](Protocol):
|
|
3990
|
-
|
|
3990
|
+
"""
|
|
3991
3991
|
Calculates an implementation-dependent approximation of the principal value of the inverse tangent for each element ``x_i`` of the input array ``x``.
|
|
3992
3992
|
|
|
3993
3993
|
Each element-wise result is expressed in radians.
|
|
@@ -4103,7 +4103,7 @@ class atan2[TArray: Array](Protocol):
|
|
|
4103
4103
|
|
|
4104
4104
|
@runtime_checkable
|
|
4105
4105
|
class atanh[TArray: Array](Protocol):
|
|
4106
|
-
|
|
4106
|
+
"""
|
|
4107
4107
|
Calculates an implementation-dependent approximation to the inverse hyperbolic tangent for each element ``x_i`` of the input array ``x``.
|
|
4108
4108
|
|
|
4109
4109
|
.. note::
|
|
@@ -4385,7 +4385,7 @@ class conj[TArray: Array](Protocol):
|
|
|
4385
4385
|
|
|
4386
4386
|
@runtime_checkable
|
|
4387
4387
|
class cos[TArray: Array](Protocol):
|
|
4388
|
-
|
|
4388
|
+
"""
|
|
4389
4389
|
Calculates an implementation-dependent approximation to the cosine for each element ``x_i`` of the input array ``x``.
|
|
4390
4390
|
|
|
4391
4391
|
Each element ``x_i`` is assumed to be expressed in radians.
|
|
@@ -4436,7 +4436,7 @@ class cos[TArray: Array](Protocol):
|
|
|
4436
4436
|
|
|
4437
4437
|
@runtime_checkable
|
|
4438
4438
|
class cosh[TArray: Array](Protocol):
|
|
4439
|
-
|
|
4439
|
+
"""
|
|
4440
4440
|
Calculates an implementation-dependent approximation to the hyperbolic cosine for each element ``x_i`` in the input array ``x``.
|
|
4441
4441
|
|
|
4442
4442
|
The mathematical definition of the hyperbolic cosine is
|
|
@@ -4503,7 +4503,7 @@ class cosh[TArray: Array](Protocol):
|
|
|
4503
4503
|
|
|
4504
4504
|
@runtime_checkable
|
|
4505
4505
|
class divide[TArray: Array](Protocol):
|
|
4506
|
-
|
|
4506
|
+
"""
|
|
4507
4507
|
Calculates the division of each element ``x1_i`` of the input array ``x1`` with the respective element ``x2_i`` of the input array ``x2``.
|
|
4508
4508
|
|
|
4509
4509
|
.. note::
|
|
@@ -4796,7 +4796,7 @@ class floor[TArray: Array](Protocol):
|
|
|
4796
4796
|
|
|
4797
4797
|
@runtime_checkable
|
|
4798
4798
|
class floor_divide[TArray: Array](Protocol):
|
|
4799
|
-
|
|
4799
|
+
"""
|
|
4800
4800
|
Rounds the result of dividing each element ``x1_i`` of the input array ``x1`` by the respective element ``x2_i`` of the input array ``x2`` to the greatest (i.e., closest to `+infinity`) integer-value number that is not greater than the division result.
|
|
4801
4801
|
|
|
4802
4802
|
.. note::
|
|
@@ -5105,7 +5105,7 @@ class less_equal[TArray: Array](Protocol):
|
|
|
5105
5105
|
|
|
5106
5106
|
@runtime_checkable
|
|
5107
5107
|
class log[TArray: Array](Protocol):
|
|
5108
|
-
|
|
5108
|
+
"""
|
|
5109
5109
|
Calculates an implementation-dependent approximation to the natural (base ``e``) logarithm for each element ``x_i`` of the input array ``x``.
|
|
5110
5110
|
|
|
5111
5111
|
.. note::
|
|
@@ -5171,7 +5171,7 @@ class log[TArray: Array](Protocol):
|
|
|
5171
5171
|
|
|
5172
5172
|
@runtime_checkable
|
|
5173
5173
|
class log1p[TArray: Array](Protocol):
|
|
5174
|
-
|
|
5174
|
+
"""
|
|
5175
5175
|
Calculates an implementation-dependent approximation to ``log(1+x)``, where ``log`` refers to the natural (base ``e``) logarithm, for each element ``x_i`` of the input array ``x``.
|
|
5176
5176
|
|
|
5177
5177
|
.. note::
|
|
@@ -5237,7 +5237,7 @@ class log1p[TArray: Array](Protocol):
|
|
|
5237
5237
|
|
|
5238
5238
|
@runtime_checkable
|
|
5239
5239
|
class log2[TArray: Array](Protocol):
|
|
5240
|
-
|
|
5240
|
+
"""
|
|
5241
5241
|
Calculates an implementation-dependent approximation to the base ``2`` logarithm for each element ``x_i`` of the input array ``x``.
|
|
5242
5242
|
|
|
5243
5243
|
.. note::
|
|
@@ -5283,7 +5283,7 @@ class log2[TArray: Array](Protocol):
|
|
|
5283
5283
|
|
|
5284
5284
|
@runtime_checkable
|
|
5285
5285
|
class log10[TArray: Array](Protocol):
|
|
5286
|
-
|
|
5286
|
+
"""
|
|
5287
5287
|
Calculates an implementation-dependent approximation to the base ``10`` logarithm for each element ``x_i`` of the input array ``x``.
|
|
5288
5288
|
|
|
5289
5289
|
.. note::
|
|
@@ -5464,7 +5464,7 @@ class logical_xor[TArray: Array](Protocol):
|
|
|
5464
5464
|
|
|
5465
5465
|
@runtime_checkable
|
|
5466
5466
|
class multiply[TArray: Array](Protocol):
|
|
5467
|
-
|
|
5467
|
+
"""
|
|
5468
5468
|
Calculates the product for each element ``x1_i`` of the input array ``x1`` with the respective element ``x2_i`` of the input array ``x2``.
|
|
5469
5469
|
|
|
5470
5470
|
.. note::
|
|
@@ -5642,7 +5642,7 @@ class positive[TArray: Array](Protocol):
|
|
|
5642
5642
|
|
|
5643
5643
|
@runtime_checkable
|
|
5644
5644
|
class pow[TArray: Array](Protocol):
|
|
5645
|
-
|
|
5645
|
+
"""
|
|
5646
5646
|
Calculates an implementation-dependent approximation of exponentiation by raising each element ``x1_i`` (the base) of the input array ``x1`` to the power of ``x2_i`` (the exponent), where ``x2_i`` is the corresponding element of the input array ``x2``.
|
|
5647
5647
|
|
|
5648
5648
|
.. note::
|
|
@@ -5847,7 +5847,7 @@ class round[TArray: Array](Protocol):
|
|
|
5847
5847
|
|
|
5848
5848
|
@runtime_checkable
|
|
5849
5849
|
class sign[TArray: Array](Protocol):
|
|
5850
|
-
|
|
5850
|
+
"""
|
|
5851
5851
|
Returns an indication of the sign of a number for each element ``x_i`` of the input array ``x``.
|
|
5852
5852
|
|
|
5853
5853
|
The sign function (also known as the **signum function**) of a number :math:`x_i` is defined as
|
|
@@ -5898,7 +5898,7 @@ class sign[TArray: Array](Protocol):
|
|
|
5898
5898
|
|
|
5899
5899
|
@runtime_checkable
|
|
5900
5900
|
class sin[TArray: Array](Protocol):
|
|
5901
|
-
|
|
5901
|
+
"""
|
|
5902
5902
|
Calculates an implementation-dependent approximation to the sine for each element ``x_i`` of the input array ``x``.
|
|
5903
5903
|
|
|
5904
5904
|
Each element ``x_i`` is assumed to be expressed in radians.
|
|
@@ -5948,7 +5948,7 @@ class sin[TArray: Array](Protocol):
|
|
|
5948
5948
|
|
|
5949
5949
|
@runtime_checkable
|
|
5950
5950
|
class sinh[TArray: Array](Protocol):
|
|
5951
|
-
|
|
5951
|
+
"""
|
|
5952
5952
|
Calculates an implementation-dependent approximation to the hyperbolic sine for each element ``x_i`` of the input array ``x``.
|
|
5953
5953
|
|
|
5954
5954
|
The mathematical definition of the hyperbolic sine is
|
|
@@ -6015,7 +6015,7 @@ class sinh[TArray: Array](Protocol):
|
|
|
6015
6015
|
|
|
6016
6016
|
@runtime_checkable
|
|
6017
6017
|
class square[TArray: Array](Protocol):
|
|
6018
|
-
|
|
6018
|
+
"""
|
|
6019
6019
|
Squares each element ``x_i`` of the input array ``x``.
|
|
6020
6020
|
|
|
6021
6021
|
The square of a number ``x_i`` is defined as
|
|
@@ -6050,7 +6050,7 @@ class square[TArray: Array](Protocol):
|
|
|
6050
6050
|
|
|
6051
6051
|
@runtime_checkable
|
|
6052
6052
|
class sqrt[TArray: Array](Protocol):
|
|
6053
|
-
|
|
6053
|
+
"""
|
|
6054
6054
|
Calculates the principal square root for each element ``x_i`` of the input array ``x``.
|
|
6055
6055
|
|
|
6056
6056
|
.. note::
|
|
@@ -6095,8 +6095,8 @@ class sqrt[TArray: Array](Protocol):
|
|
|
6095
6095
|
- If ``a`` is either ``+0`` or ``-0`` and ``b`` is ``+0``, the result is ``+0 + 0j``.
|
|
6096
6096
|
- If ``a`` is any value (including ``NaN``) and ``b`` is ``+infinity``, the result is ``+infinity + infinity j``.
|
|
6097
6097
|
- If ``a`` is a finite number and ``b`` is ``NaN``, the result is ``NaN + NaN j``.
|
|
6098
|
-
- If ``a`` ``-infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is
|
|
6099
|
-
- If ``a`` is ``+infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+
|
|
6098
|
+
- If ``a`` ``-infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+0 + infinity j``.
|
|
6099
|
+
- If ``a`` is ``+infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+infinity + 0 j``.
|
|
6100
6100
|
- If ``a`` is ``-infinity`` and ``b`` is ``NaN``, the result is ``NaN + infinity j`` (sign of the imaginary component is unspecified).
|
|
6101
6101
|
- If ``a`` is ``+infinity`` and ``b`` is ``NaN``, the result is ``+infinity + NaN j``.
|
|
6102
6102
|
- If ``a`` is ``NaN`` and ``b`` is any value, the result is ``NaN + NaN j``.
|
|
@@ -6144,7 +6144,7 @@ class subtract[TArray: Array](Protocol):
|
|
|
6144
6144
|
|
|
6145
6145
|
@runtime_checkable
|
|
6146
6146
|
class tan[TArray: Array](Protocol):
|
|
6147
|
-
|
|
6147
|
+
"""
|
|
6148
6148
|
Calculates an implementation-dependent approximation to the tangent for each element ``x_i`` of the input array ``x``.
|
|
6149
6149
|
|
|
6150
6150
|
Each element ``x_i`` is assumed to be expressed in radians.
|
|
@@ -6194,7 +6194,7 @@ class tan[TArray: Array](Protocol):
|
|
|
6194
6194
|
|
|
6195
6195
|
@runtime_checkable
|
|
6196
6196
|
class tanh[TArray: Array](Protocol):
|
|
6197
|
-
|
|
6197
|
+
"""
|
|
6198
6198
|
Calculates an implementation-dependent approximation to the hyperbolic tangent for each element ``x_i`` of the input array ``x``.
|
|
6199
6199
|
|
|
6200
6200
|
The mathematical definition of the hyperbolic tangent is
|
|
@@ -7290,7 +7290,7 @@ class tensordot[TArray: Array](Protocol):
|
|
|
7290
7290
|
|
|
7291
7291
|
@runtime_checkable
|
|
7292
7292
|
class vecdot[TArray: Array](Protocol):
|
|
7293
|
-
|
|
7293
|
+
"""
|
|
7294
7294
|
Computes the (vector) dot product of two arrays.
|
|
7295
7295
|
|
|
7296
7296
|
Let :math:`\\mathbf{a}` be a vector in ``x1`` and :math:`\\mathbf{b}` be a corresponding vector in ``x2``. The dot product is defined as
|
|
@@ -7425,7 +7425,7 @@ class expand_dims[TArray: Array](Protocol):
|
|
|
7425
7425
|
"""
|
|
7426
7426
|
|
|
7427
7427
|
@abstractmethod
|
|
7428
|
-
def __call__(self, x: TArray, /,
|
|
7428
|
+
def __call__(self, x: TArray, /, axis: int) -> TArray: ...
|
|
7429
7429
|
|
|
7430
7430
|
|
|
7431
7431
|
@runtime_checkable
|
|
@@ -7933,7 +7933,7 @@ class ArrayNamespace[TArray: Array, TDtype, TDevice](Protocol):
|
|
|
7933
7933
|
square: square[TArray,]
|
|
7934
7934
|
"Squares each element ``x_i`` of the input array ``x``.\n\nThe square of a number ``x_i`` is defined as\n\n.. math::\n x_i^2 = x_i \\cdot x_i\n\nParameters\n----------\nx: array\n input array. Should have a numeric data type.\n\nReturns\n-------\nout: array\n an array containing the evaluated result for each element in ``x``. The returned array must have a data type determined by :ref:`type-promotion`.\n\nNotes\n-----\n\n**Special cases**\n\nFor floating-point operands, special cases must be handled as if the operation is implemented as ``x * x`` (see :func:`~array_api.multiply`).\n\n.. versionchanged:: 2022.12\n Added complex data type support."
|
|
7935
7935
|
sqrt: sqrt[TArray,]
|
|
7936
|
-
"Calculates the principal square root for each element ``x_i`` of the input array ``x``.\n\n.. note::\n After rounding, each result must be indistinguishable from the infinitely precise result (as required by IEEE 754).\n\n.. note::\n For complex floating-point operands, ``sqrt(conj(x))`` must equal ``conj(sqrt(x))``.\n\n.. note::\n By convention, the branch cut of the square root is the negative real axis :math:`(-\\infty, 0)`.\n\n The square root is a continuous function from above the branch cut, taking into account the sign of the imaginary component.\n\n Accordingly, for complex arguments, the function returns the square root in the range of the right half-plane, including the imaginary axis (i.e., the plane defined by :math:`[0, +\\infty)` along the real axis and :math:`(-\\infty, +\\infty)` along the imaginary axis).\n\n *Note: branch cuts follow C99 and have provisional status* (see :ref:`branch-cuts`).\n\nParameters\n----------\nx: array\n input array. Should have a floating-point data type.\n\nReturns\n-------\nout: array\n an array containing the square root of each element in ``x``. The returned array must have a floating-point data type determined by :ref:`type-promotion`.\n\nNotes\n-----\n\n**Special cases**\n\nFor real-valued floating-point operands,\n\n- If ``x_i`` is ``NaN``, the result is ``NaN``.\n- If ``x_i`` is less than ``0``, the result is ``NaN``.\n- If ``x_i`` is ``+0``, the result is ``+0``.\n- If ``x_i`` is ``-0``, the result is ``-0``.\n- If ``x_i`` is ``+infinity``, the result is ``+infinity``.\n\nFor complex floating-point operands, let ``a = real(x_i)``, ``b = imag(x_i)``, and\n\n- If ``a`` is either ``+0`` or ``-0`` and ``b`` is ``+0``, the result is ``+0 + 0j``.\n- If ``a`` is any value (including ``NaN``) and ``b`` is ``+infinity``, the result is ``+infinity + infinity j``.\n- If ``a`` is a finite number and ``b`` is ``NaN``, the result is ``NaN + NaN j``.\n- If ``a`` ``-infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is
|
|
7936
|
+
"Calculates the principal square root for each element ``x_i`` of the input array ``x``.\n\n.. note::\n After rounding, each result must be indistinguishable from the infinitely precise result (as required by IEEE 754).\n\n.. note::\n For complex floating-point operands, ``sqrt(conj(x))`` must equal ``conj(sqrt(x))``.\n\n.. note::\n By convention, the branch cut of the square root is the negative real axis :math:`(-\\infty, 0)`.\n\n The square root is a continuous function from above the branch cut, taking into account the sign of the imaginary component.\n\n Accordingly, for complex arguments, the function returns the square root in the range of the right half-plane, including the imaginary axis (i.e., the plane defined by :math:`[0, +\\infty)` along the real axis and :math:`(-\\infty, +\\infty)` along the imaginary axis).\n\n *Note: branch cuts follow C99 and have provisional status* (see :ref:`branch-cuts`).\n\nParameters\n----------\nx: array\n input array. Should have a floating-point data type.\n\nReturns\n-------\nout: array\n an array containing the square root of each element in ``x``. The returned array must have a floating-point data type determined by :ref:`type-promotion`.\n\nNotes\n-----\n\n**Special cases**\n\nFor real-valued floating-point operands,\n\n- If ``x_i`` is ``NaN``, the result is ``NaN``.\n- If ``x_i`` is less than ``0``, the result is ``NaN``.\n- If ``x_i`` is ``+0``, the result is ``+0``.\n- If ``x_i`` is ``-0``, the result is ``-0``.\n- If ``x_i`` is ``+infinity``, the result is ``+infinity``.\n\nFor complex floating-point operands, let ``a = real(x_i)``, ``b = imag(x_i)``, and\n\n- If ``a`` is either ``+0`` or ``-0`` and ``b`` is ``+0``, the result is ``+0 + 0j``.\n- If ``a`` is any value (including ``NaN``) and ``b`` is ``+infinity``, the result is ``+infinity + infinity j``.\n- If ``a`` is a finite number and ``b`` is ``NaN``, the result is ``NaN + NaN j``.\n- If ``a`` ``-infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+0 + infinity j``.\n- If ``a`` is ``+infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+infinity + 0 j``.\n- If ``a`` is ``-infinity`` and ``b`` is ``NaN``, the result is ``NaN + infinity j`` (sign of the imaginary component is unspecified).\n- If ``a`` is ``+infinity`` and ``b`` is ``NaN``, the result is ``+infinity + NaN j``.\n- If ``a`` is ``NaN`` and ``b`` is any value, the result is ``NaN + NaN j``.\n- If ``a`` is ``NaN`` and ``b`` is ``NaN``, the result is ``NaN + NaN j``.\n\n.. versionchanged:: 2022.12\n Added complex data type support."
|
|
7937
7937
|
subtract: subtract[TArray,]
|
|
7938
7938
|
"Calculates the difference for each element ``x1_i`` of the input array ``x1`` with the respective element ``x2_i`` of the input array ``x2``.\n\nThe result of ``x1_i - x2_i`` must be the same as ``x1_i + (-x2_i)`` and must be governed by the same floating-point rules as addition (see :meth:`add`).\n\nParameters\n----------\nx1: array\n first input array. Should have a numeric data type.\nx2: array\n second input array. Must be compatible with ``x1`` (see :ref:`broadcasting`). Should have a numeric data type.\n\nReturns\n-------\nout: array\n an array containing the element-wise differences. The returned array must have a data type determined by :ref:`type-promotion`.\n\nNotes\n-----\n\n.. versionchanged:: 2022.12\n Added complex data type support."
|
|
7939
7939
|
tan: tan[TArray,]
|