From dc5b5d40c753a249bfbfa4dc420b5c47cfce5d8a Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Wed, 20 Jan 2021 14:13:37 -0700 Subject: [PATCH 1/5] Fix some typos in some type annotations --- spec/API_specification/creation_functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/API_specification/creation_functions.md b/spec/API_specification/creation_functions.md index 43ff15935..d8f2af650 100644 --- a/spec/API_specification/creation_functions.md +++ b/spec/API_specification/creation_functions.md @@ -143,7 +143,7 @@ Returns a new array having a specified `shape` and filled with `fill_value`. - output array shape. -- **fill_value**: _Union\[ int, float ] ]_ +- **fill_value**: _Union\[ int, float ]_ - fill value. @@ -172,7 +172,7 @@ Returns a new array filled with `fill_value` and having the same `shape` as an i - input array from which to derive the output array shape. -- **fill_value**: _Union\[ int, float ] ]_ +- **fill_value**: _Union\[ int, float ]_ - fill value. From f11f7c047508d0b5202e842b445dd01a33d36c51 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Wed, 20 Jan 2021 14:35:30 -0700 Subject: [PATCH 2/5] Remove dtype from where() type annotation --- spec/API_specification/searching_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/API_specification/searching_functions.md b/spec/API_specification/searching_functions.md index ef346d451..d3d06d7a6 100644 --- a/spec/API_specification/searching_functions.md +++ b/spec/API_specification/searching_functions.md @@ -90,7 +90,7 @@ Returns elements chosen from `x1` or `x2` depending on `condition`. #### Parameters -- **condition**: _<array<bool>>_ +- **condition**: _<array>_ - when `True`, yield `x1_i`; otherwise, yield `x2_i`. Must be compatible with `x1` and `x2` (see {ref}`broadcasting`). From 89fe85aaf481f01bafdf11fde44a82788c9fceed Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Wed, 20 Jan 2021 16:10:07 -0700 Subject: [PATCH 3/5] Fix type annotation for ord Optional only takes one argument. It must be Optional[Union[...]] to be valid. --- spec/API_specification/linear_algebra_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/API_specification/linear_algebra_functions.md b/spec/API_specification/linear_algebra_functions.md index ba92aa7b0..209a2f787 100644 --- a/spec/API_specification/linear_algebra_functions.md +++ b/spec/API_specification/linear_algebra_functions.md @@ -183,7 +183,7 @@ Computes the matrix or vector norm of `x`. - If `True`, the axes (dimensions) specified by `axis` must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array (see {ref}`broadcasting`). Otherwise, if `False`, the axes (dimensions) specified by `axis` must not be included in the result. Default: `False`. -- **ord**: _Optional\[ int, float, Literal\[ inf, -inf, 'fro', 'nuc' ] ]_ +- **ord**: _Optional\[ Union\[ int, float, Literal\[ inf, -inf, 'fro', 'nuc' ] ] ]_ - order of the norm. The following mathematical norms must be supported: From c522de42e44ae6898d0db7e8752e5d9ac50b8d99 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Wed, 20 Jan 2021 17:48:42 -0700 Subject: [PATCH 4/5] Fix the type annotation for the axis argument to stack Since the default is an integer, None is not defined. --- spec/API_specification/manipulation_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/API_specification/manipulation_functions.md b/spec/API_specification/manipulation_functions.md index 3243c2830..41f207ea7 100644 --- a/spec/API_specification/manipulation_functions.md +++ b/spec/API_specification/manipulation_functions.md @@ -158,7 +158,7 @@ Joins a sequence of arrays along a new axis. - input arrays to join. Each array must have the same shape. -- **axis**: _Optional\[ int ]_ +- **axis**: _int_ - axis along which the arrays will be joined. Providing an `axis` specifies the index of the new axis in the dimensions of the result. For example, if `axis` is `0`, the new axis will be the first dimension and the output array will have shape `(N, A, B, C)`; if `axis` is `1`, the new axis will be the second dimension and the output array will have shape `(A, N, B, C)`; and, if `axis` is `-1`, the new axis will be the last dimension and the output array will have shape `(A, B, C, N)`. A valid `axis` must be on the interval `[-N, N)`, where `N` is the rank (number of dimensions) of `x`. If provided an `axis` outside of the required interval, the function must raise an exception. Default: `0`. From 8f24f2bb8580565bd2c70de3a4473b3d625f5cc3 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Wed, 20 Jan 2021 17:53:26 -0700 Subject: [PATCH 5/5] Fix the type annotation for the endpoint argument to linspace endpoint=None is not defined, so it should not be Optional. --- spec/API_specification/creation_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/API_specification/creation_functions.md b/spec/API_specification/creation_functions.md index d8f2af650..cf0674404 100644 --- a/spec/API_specification/creation_functions.md +++ b/spec/API_specification/creation_functions.md @@ -222,7 +222,7 @@ Returns evenly spaced numbers over a specified interval. - device to place the created array on, if given. Default: `None`. -- **endpoint**: _Optional\[ bool ]_ +- **endpoint**: _bool_ - boolean indicating whether to include `stop` in the interval. Default: `True`.