Skip to content

Commit 2e759ef

Browse files
authored
Add data type guidance (#173)
1 parent 0c5d913 commit 2e759ef

File tree

2 files changed

+59
-59
lines changed

2 files changed

+59
-59
lines changed

spec/API_specification/array_object.md

+58-58
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ For floating-point operands, let `self` equal `x`.
288288

289289
- **self**: _<array>_
290290

291-
- array instance.
291+
- array instance. Should have a numeric data type.
292292

293293
#### Returns
294294

@@ -337,11 +337,11 @@ Floating-point addition is a commutative operation, but not always associative.
337337

338338
- **self**: _<array>_
339339

340-
- array instance (augend array).
340+
- array instance (augend array). Should have a numeric data type.
341341

342-
- **other**: _<array>_
342+
- **other**: _Union\[ int, float, <array> ]_
343343

344-
- addend array. Must be compatible with `self` (see {ref}`broadcasting`).
344+
- addend array. Must be compatible with `self` (see {ref}`broadcasting`). Should have a numeric data type.
345345

346346
#### Returns
347347

@@ -363,11 +363,11 @@ Evaluates `self_i & other_i` for each element of an array instance with the resp
363363

364364
- **self**: _<array>_
365365

366-
- array instance. Must have an integer or boolean data type.
366+
- array instance. Should have an integer or boolean data type.
367367

368-
- **other**: _<array>_
368+
- **other**: _Union\[ int, bool, <array> ]_
369369

370-
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Must have an integer or boolean data type.
370+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Should have an integer or boolean data type.
371371

372372
#### Returns
373373

@@ -505,11 +505,11 @@ Computes the truth value of `self_i == other_i` for each element of an array ins
505505
506506
- **self**: _<array>_
507507
508-
- array instance.
508+
- array instance. May have any data type.
509509
510-
- **other**: _<array>_
510+
- **other**: _Union\[ int, float, bool, <array> ]_
511511
512-
- other array. Must be compatible with `self` (see {ref}`broadcasting`).
512+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). May have any data type.
513513
514514
#### Returns
515515
@@ -548,11 +548,11 @@ Evaluates `self_i // other_i` for each element of an array instance with the res
548548

549549
- **self**: _<array>_
550550

551-
- array instance.
551+
- array instance. Should have a numeric data type.
552552

553-
- **other**: _<array>_
553+
- **other**: _Union\[ int, float, <array> ]_
554554

555-
- other array. Must be compatible with `self` (see {ref}`broadcasting`).
555+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Should have a numeric data type.
556556

557557
#### Returns
558558

@@ -574,11 +574,11 @@ Computes the truth value of `self_i >= other_i` for each element of an array ins
574574

575575
- **self**: _<array>_
576576

577-
- array instance.
577+
- array instance. Should have a numeric data type.
578578

579-
- **other**: _<array>_
579+
- **other**: _Union\[ int, float, <array> ]_
580580

581-
- other array. Must be compatible with `self` (see {ref}`broadcasting`).
581+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Should have a numeric data type.
582582

583583
#### Returns
584584

@@ -621,11 +621,11 @@ Computes the truth value of `self_i > other_i` for each element of an array inst
621621

622622
- **self**: _<array>_
623623

624-
- array instance.
624+
- array instance. Should have a numeric data type.
625625

626-
- **other**: _<array>_
626+
- **other**: _Union\[ int, float, <array> ]_
627627

628-
- other array. Must be compatible with `self` (see {ref}`broadcasting`).
628+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Should have a numeric data type.
629629

630630
#### Returns
631631

@@ -664,7 +664,7 @@ Evaluates `~self_i` for each element of an array instance.
664664

665665
- **self**: _<array>_
666666

667-
- array instance. Must have an integer or boolean data type.
667+
- array instance. Should have an integer or boolean data type.
668668

669669
#### Returns
670670

@@ -686,11 +686,11 @@ Computes the truth value of `self_i <= other_i` for each element of an array ins
686686

687687
- **self**: _&lt;array&gt;_
688688

689-
- array instance.
689+
- array instance. Should have a numeric data type.
690690

691-
- **other**: _&lt;array&gt;_
691+
- **other**: _Union\[ int, float, &lt;array&gt; ]_
692692

693-
- other array. Must be compatible with `self` (see {ref}`broadcasting`).
693+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Should have a numeric data type.
694694

695695
#### Returns
696696

@@ -717,11 +717,11 @@ Evaluates `self_i << other_i` for each element of an array instance with the res
717717

718718
- **self**: _&lt;array&gt;_
719719

720-
- array instance. Must have an integer data type.
720+
- array instance. Should have an integer data type.
721721

722-
- **other**: _&lt;array&gt;_
722+
- **other**: _Union\[ int, &lt;array&gt; ]_
723723

724-
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Must have an integer data type. Each element must be greater than or equal to `0`.
724+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Should have an integer data type. Each element must be greater than or equal to `0`.
725725

726726
#### Returns
727727

@@ -743,11 +743,11 @@ Computes the truth value of `self_i < other_i` for each element of an array inst
743743

744744
- **self**: _&lt;array&gt;_
745745

746-
- array instance.
746+
- array instance. Should have a numeric data type.
747747

748-
- **other**: _&lt;array&gt;_
748+
- **other**: _Union\[ int, float, &lt;array&gt; ]_
749749

750-
- other array. Must be compatible with `self` (see {ref}`broadcasting`).
750+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Should have a numeric data type.
751751

752752
#### Returns
753753

@@ -790,11 +790,11 @@ Evaluates `self_i % other_i` for each element of an array instance with the resp
790790

791791
- **self**: _&lt;array&gt;_
792792

793-
- array instance.
793+
- array instance. Should have a numeric data type.
794794

795-
- **other**: _&lt;array&gt;_
795+
- **other**: _Union\[ int, float, &lt;array&gt; ]_
796796

797-
- other array. Must be compatible with `self` (see {ref}`broadcasting`).
797+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Should have a numeric data type.
798798

799799
#### Returns
800800

@@ -835,11 +835,11 @@ Floating-point multiplication is not always associative due to finite precision.
835835

836836
- **self**: _&lt;array&gt;_
837837

838-
- array instance.
838+
- array instance. Should have a numeric data type.
839839

840-
- **other**: _&lt;array&gt;_
840+
- **other**: _Union\[ int, float, &lt;array&gt; ]_
841841

842-
- other array. Must be compatible with `self` (see {ref}`broadcasting`).
842+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Should have a numeric data type.
843843

844844
#### Returns
845845

@@ -861,11 +861,11 @@ Computes the truth value of `self_i != other_i` for each element of an array ins
861861

862862
- **self**: _&lt;array&gt;_
863863

864-
- array instance.
864+
- array instance. May have any data type.
865865

866-
- **other**: _&lt;array&gt;_
866+
- **other**: _Union\[ int, float, bool, &lt;array&gt; ]_
867867

868-
- other array. Must be compatible with `self` (see {ref}`broadcasting`).
868+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). May have any data type.
869869

870870
#### Returns
871871

@@ -887,7 +887,7 @@ Evaluates `-self_i` for each element of an array instance.
887887

888888
- **self**: _&lt;array&gt;_
889889

890-
- array instance.
890+
- array instance. Should have a numeric data type.
891891

892892
#### Returns
893893

@@ -909,11 +909,11 @@ Evaluates `self_i | other_i` for each element of an array instance with the resp
909909

910910
- **self**: _&lt;array&gt;_
911911

912-
- array instance. Must have an integer or boolean data type.
912+
- array instance. Should have an integer or boolean data type.
913913

914-
- **other**: _&lt;array&gt;_
914+
- **other**: _Union\[ int, bool, &lt;array&gt; ]_
915915

916-
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Must have an integer or boolean data type.
916+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Should have an integer or boolean data type.
917917

918918
#### Returns
919919

@@ -935,7 +935,7 @@ Evaluates `+self_i` for each element of an array instance.
935935

936936
- **self**: _&lt;array&gt;_
937937

938-
- array instance.
938+
- array instance. Should have a numeric data type.
939939

940940
#### Returns
941941

@@ -986,11 +986,11 @@ For floating-point operands, let `self` equal `x1` and `other` equal `x2`.
986986

987987
- **self**: _&lt;array&gt;_
988988

989-
- array instance whose elements correspond to the exponentiation base.
989+
- array instance whose elements correspond to the exponentiation base. Should have a numeric data type.
990990

991-
- **other**: _&lt;array&gt;_
991+
- **other**: _Union\[ int, float, &lt;array&gt; ]_
992992

993-
- other array whose elements correspond to the exponentiation exponent. Must be compatible with `self` (see {ref}`broadcasting`).
993+
- other array whose elements correspond to the exponentiation exponent. Must be compatible with `self` (see {ref}`broadcasting`). Should have a numeric data type.
994994

995995
#### Returns
996996

@@ -1012,11 +1012,11 @@ Evaluates `self_i >> other_i` for each element of an array instance with the res
10121012

10131013
- **self**: _&lt;array&gt;_
10141014

1015-
- array instance. Must have an integer data type.
1015+
- array instance. Should have an integer data type.
10161016

1017-
- **other**: _&lt;array&gt;_
1017+
- **other**: _Union\[ int, &lt;array&gt; ]_
10181018

1019-
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Must have an integer data type. Each element must be greater than or equal to `0`.
1019+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Should have an integer data type. Each element must be greater than or equal to `0`.
10201020

10211021
#### Returns
10221022

@@ -1043,11 +1043,11 @@ Calculates the difference for each element of an array instance with the respect
10431043

10441044
- **self**: _&lt;array&gt;_
10451045

1046-
- array instance (minuend array).
1046+
- array instance (minuend array). Should have a numeric data type.
10471047

1048-
- **other**: _&lt;array&gt;_
1048+
- **other**: _Union\[ int, float, &lt;array&gt; ]_
10491049

1050-
- subtrahend array. Must be compatible with `self` (see {ref}`broadcasting`).
1050+
- subtrahend array. Must be compatible with `self` (see {ref}`broadcasting`). Should have a numeric data type.
10511051

10521052
#### Returns
10531053

@@ -1096,11 +1096,11 @@ For floating-point operands, let `self` equal `x1` and `other` equal `x2`.
10961096

10971097
- **self**: _&lt;array&gt;_
10981098

1099-
- array instance.
1099+
- array instance. Should have a numeric data type.
11001100

1101-
- **other**: _&lt;array&gt;_
1101+
- **other**: _Union\[ int, float, &lt;array&gt; ]_
11021102

1103-
- other array. Must be compatible with `self` (see {ref}`broadcasting`).
1103+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Should have a numeric data type.
11041104

11051105
#### Returns
11061106

@@ -1122,11 +1122,11 @@ Evaluates `self_i ^ other_i` for each element of an array instance with the resp
11221122

11231123
- **self**: _&lt;array&gt;_
11241124

1125-
- array instance. Must have an integer or boolean data type.
1125+
- array instance. Should have an integer or boolean data type.
11261126

1127-
- **other**: _&lt;array&gt;_
1127+
- **other**: _Union\[ int, bool, &lt;array&gt; ]_
11281128

1129-
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Must have an integer or boolean data type.
1129+
- other array. Must be compatible with `self` (see {ref}`broadcasting`). Should have an integer or boolean data type.
11301130

11311131
#### Returns
11321132

spec/API_specification/elementwise_functions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ Computes the truth value of `x1_i == x2_i` for each element `x1_i` of the input
570570

571571
- **x2**: _&lt;array&gt;_
572572

573-
- second input array. Must be compatible with `x1` (see {ref}`broadcasting`).
573+
- second input array. Must be compatible with `x1` (see {ref}`broadcasting`). May have any data type.
574574

575575
#### Returns
576576

0 commit comments

Comments
 (0)