Skip to content

Add specifications for array manipulation functions #42

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

Merged
merged 14 commits into from
Sep 28, 2020
Prev Previous commit
Next Next commit
Address PR feedback
  • Loading branch information
kgryte committed Sep 21, 2020
commit db52cbdf6ecf35706196b3834e8b46525b48bd2b
17 changes: 13 additions & 4 deletions spec/API_specification/manipulation_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ A conforming implementation of the array API standard must provide and support t

- Positional parameters must be [positional-only](https://www.python.org/dev/peps/pep-0570/) parameters. Positional-only parameters have no externally-usable name. When a function accepting positional-only parameters is called, positional arguments are mapped to these parameters based solely on their order.
- Optional parameters must be [keyword-only](https://www.python.org/dev/peps/pep-3102/) arguments.
- Unless stated otherwise, functions must adhere to the type promotion rules defined in :ref:`type-promotion`.

<!-- NOTE: please keep the functions in alphabetical order -->

Expand All @@ -27,7 +28,11 @@ Joins a sequence of arrays along an existing axis.

- **out**: _&lt;array&gt;_

- an output array containing the concatenated values.
- an output array containing the concatenated values. If the input arrays have different data types, normal [type promotion rules](type_promotion.md) apply. If the input arrays have the same data type, the output array must have the same data type as the input arrays.

.. note::

This specification leaves type promotion between data type families (i.e., `intxx` and `floatxx`) unspecified.

### <a name="flip" href="#flip">#</a> flip(x, /, *, axis=None)

Expand Down Expand Up @@ -59,9 +64,9 @@ Reshapes an array without changing its data.

- input array to reshape.

- **shape**: _Union\[ int, Tuple\[ int, ... ] ]_
- **shape**: _Tuple\[ int, ... ]_

- a new shape compatible with the original shape. If `shape` is an integer, then the result must be a one-dimensional array of that length. One shape dimension is allowed to be `-1`. When a shape dimension is `-1`, the corresponding output array shape dimension must be inferred from the length of the array and the remaining dimensions.
- a new shape compatible with the original shape. One shape dimension is allowed to be `-1`. When a shape dimension is `-1`, the corresponding output array shape dimension must be inferred from the length of the array and the remaining dimensions.

#### Returns

Expand Down Expand Up @@ -131,4 +136,8 @@ Joins a sequence of arrays along a new axis.

- **out**: _&lt;array&gt;_

- an output array having rank `N+1`, where `N` is the rank (number of dimensions) of `x`.
- an output array having rank `N+1`, where `N` is the rank (number of dimensions) of `x`. If the input arrays have different data types, normal [type promotion rules](type_promotion.md) apply. If the input arrays have the same data type, the output array must have the same data type as the input arrays.

.. note::

This specification leaves type promotion between data type families (i.e., `intxx` and `floatxx`) unspecified.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy