Skip to content

Commit 9f9683b

Browse files
steff456rgommers
authored andcommitted
Add version added to functions created in 2022
1 parent bd90fb8 commit 9f9683b

File tree

6 files changed

+46
-0
lines changed

6 files changed

+46
-0
lines changed

src/array_api_stubs/_draft/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@
2121
__array_api_version__: str = "YYYY.MM"
2222
"""
2323
String representing the version of the array API specification which the conforming implementation adheres to.
24+
25+
.. versionadded:: 2022.12
2426
"""

src/array_api_stubs/_draft/array_object.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ def __complex__(self: array, /) -> complex:
269269
- If ``self`` is ``+infinity``, the result is ``+infinity + 0j``.
270270
- If ``self`` is ``-infinity``, the result is ``-infinity + 0j``.
271271
- If ``self`` is a finite number, the result is ``self + 0j``.
272+
273+
.. versionadded:: 2022.12
272274
"""
273275

274276
def __dlpack__(

src/array_api_stubs/_draft/data_type_functions.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ def finfo(type: Union[dtype, array], /) -> finfo_object:
101101
102102
real-valued floating-point data type.
103103
104+
.. versionadded:: 2022.12
105+
104106
.. versionchanged:: 2022.12
105107
Added complex data type support.
106108
"""
@@ -135,6 +137,8 @@ def iinfo(type: Union[dtype, array], /) -> iinfo_object:
135137
- **dtype**: dtype
136138
137139
integer data type.
140+
141+
.. versionadded:: 2022.12
138142
"""
139143

140144

@@ -173,6 +177,8 @@ def isdtype(
173177
-------
174178
out: bool
175179
boolean indicating whether a provided dtype is of a specified data type kind.
180+
181+
.. versionadded:: 2022.12
176182
"""
177183

178184

src/array_api_stubs/_draft/elementwise_functions.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,8 @@ def conj(x: array, /) -> array:
733733
-------
734734
out: array
735735
an array containing the element-wise results. The returned array must have the same data type as ``x``.
736+
737+
.. versionadded:: 2022.12
736738
"""
737739

738740

@@ -1234,6 +1236,8 @@ def imag(x: array, /) -> array:
12341236
-------
12351237
out: array
12361238
an array containing the element-wise results. The returned array must have a floating-point data type with the same floating-point precision as ``x`` (e.g., if ``x`` is ``complex64``, the returned array must have the floating-point data type ``float32``).
1239+
1240+
.. versionadded:: 2022.12
12371241
"""
12381242

12391243

@@ -1941,6 +1945,8 @@ def real(x: array, /) -> array:
19411945
-------
19421946
out: array
19431947
an array containing the element-wise results. The returned array must have a floating-point data type with the same floating-point precision as ``x`` (e.g., if ``x`` is ``complex64``, the returned array must have the floating-point data type ``float32``).
1948+
1949+
.. versionadded:: 2022.12
19441950
"""
19451951

19461952

src/array_api_stubs/_draft/fft.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ def fft(
4444
-------
4545
out: array
4646
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have a complex floating-point data type determined by :ref:`type-promotion`.
47+
48+
.. versionadded:: 2022.12
4749
"""
4850

4951

@@ -90,6 +92,8 @@ def ifft(
9092
-------
9193
out: array
9294
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have a complex floating-point data type determined by :ref:`type-promotion`.
95+
96+
.. versionadded:: 2022.12
9397
"""
9498

9599

@@ -143,6 +147,8 @@ def fftn(
143147
-------
144148
out: array
145149
an array transformed along the axes (dimension) indicated by ``axes``. The returned array must have a complex floating-point data type determined by :ref:`type-promotion`.
150+
151+
.. versionadded:: 2022.12
146152
"""
147153

148154

@@ -196,6 +202,8 @@ def ifftn(
196202
-------
197203
out: array
198204
an array transformed along the axes (dimension) indicated by ``axes``. The returned array must have a complex floating-point data type determined by :ref:`type-promotion`.
205+
206+
.. versionadded:: 2022.12
199207
"""
200208

201209

@@ -242,6 +250,8 @@ def rfft(
242250
-------
243251
out: array
244252
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have a complex-valued floating-point data type determined by :ref:`type-promotion`.
253+
254+
.. versionadded:: 2022.12
245255
"""
246256

247257

@@ -288,6 +298,8 @@ def irfft(
288298
-------
289299
out: array
290300
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`. The length along the transformed axis is ``n`` (if given) or ``2*(m-1)`` (otherwise).
301+
302+
.. versionadded:: 2022.12
291303
"""
292304

293305

@@ -341,6 +353,8 @@ def rfftn(
341353
-------
342354
out: array
343355
an array transformed along the axes (dimension) indicated by ``axes``. The returned array must have a complex-valued floating-point data type determined by :ref:`type-promotion`.
356+
357+
.. versionadded:: 2022.12
344358
"""
345359

346360

@@ -394,6 +408,8 @@ def irfftn(
394408
-------
395409
out: array
396410
an array transformed along the axes (dimension) indicated by ``axes``. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`. The length along the last transformed axis is ``s[-1]`` (if given) or ``2*(m - 1)`` (otherwise), and all other axes ``s[i]``.
411+
412+
.. versionadded:: 2022.12
397413
"""
398414

399415

@@ -437,6 +453,8 @@ def hfft(
437453
-------
438454
out: array
439455
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`.
456+
457+
.. versionadded:: 2022.12
440458
"""
441459

442460

@@ -480,6 +498,8 @@ def ihfft(
480498
-------
481499
out: array
482500
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have a complex-valued floating-point data type determined by :ref:`type-promotion`.
501+
502+
.. versionadded:: 2022.12
483503
"""
484504

485505

@@ -507,6 +527,8 @@ def fftfreq(n: int, /, *, d: float = 1.0, device: Optional[device] = None) -> ar
507527
-------
508528
out: array
509529
an array of length ``n`` containing the sample frequencies. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`.
530+
531+
.. versionadded:: 2022.12
510532
"""
511533

512534

@@ -536,6 +558,8 @@ def rfftfreq(n: int, /, *, d: float = 1.0, device: Optional[device] = None) -> a
536558
-------
537559
out: array
538560
an array of length ``n//2+1`` containing the sample frequencies. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`.
561+
562+
.. versionadded:: 2022.12
539563
"""
540564

541565

@@ -559,6 +583,8 @@ def fftshift(x: array, /, *, axes: Union[int, Sequence[int]] = None) -> array:
559583
-------
560584
out: array
561585
the shifted array. The returned array must have the same data type as ``x``.
586+
587+
.. versionadded:: 2022.12
562588
"""
563589

564590

@@ -580,6 +606,8 @@ def ifftshift(x: array, /, *, axes: Union[int, Sequence[int]] = None) -> array:
580606
-------
581607
out: array
582608
the shifted array. The returned array must have the same data type as ``x``.
609+
610+
.. versionadded:: 2022.12
583611
"""
584612

585613

src/array_api_stubs/_draft/indexing_functions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ def take(x: array, indices: array, /, *, axis: int) -> array:
2323
-------
2424
out: array
2525
an array having the same data type as ``x``. The output array must have the same rank (i.e., number of dimensions) as ``x`` and must have the same shape as ``x``, except for the axis specified by ``axis`` whose size must equal the number of elements in ``indices``.
26+
27+
.. versionadded:: 2022.12
2628
"""
2729

2830

0 commit comments

Comments
 (0)