Skip to content

Commit 32f25ef

Browse files
committed
Auto-generated commit
1 parent cdded38 commit 32f25ef

File tree

69 files changed

+146
-318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+146
-318
lines changed

dtypes/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ The function supports the following data type kinds:
8181
- `unsigned_integer`: unsigned integer data types.
8282
- `real`: real-valued data types.
8383
- `numeric`: numeric data types.
84+
- `typed`: typed data types.
8485
- `all`: all data types.
8586

8687
Additionally, the function supports extending the "kinds" listed above by appending an `_and_generic` suffix to the kind name (e.g., `real_and_generic`).

dtypes/docs/repl.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- unsigned_integer: unsigned integer data types.
2929
- real: real-valued data types.
3030
- numeric: numeric data types.
31+
- typed: "typed" data types.
3132
- all: all data types.
3233

3334
Additionally, the function supports extending the "kinds" listed above by

dtypes/lib/dtypes.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
"uint8",
1414
"uint8c"
1515
],
16+
"typed": [
17+
"complex64",
18+
"complex128",
19+
"float32",
20+
"float64",
21+
"int16",
22+
"int32",
23+
"int8",
24+
"uint16",
25+
"uint32",
26+
"uint8",
27+
"uint8c"
28+
],
1629
"floating_point": [
1730
"complex64",
1831
"complex128",

dtypes/test/test.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,53 @@ tape( 'the function supports returning a list of array data types (all, includin
104104
t.end();
105105
});
106106

107+
tape( 'the function supports returning a list of array data types (typed)', function test( t ) {
108+
var expected;
109+
var actual;
110+
111+
expected = [
112+
'complex64',
113+
'complex128',
114+
'float32',
115+
'float64',
116+
'int16',
117+
'int32',
118+
'int8',
119+
'uint16',
120+
'uint32',
121+
'uint8',
122+
'uint8c'
123+
];
124+
actual = dtypes( 'typed' );
125+
126+
t.deepEqual( actual, expected, 'returns expected value' );
127+
t.end();
128+
});
129+
130+
tape( 'the function supports returning a list of array data types (typed, including "generic")', function test( t ) {
131+
var expected;
132+
var actual;
133+
134+
expected = [
135+
'complex64',
136+
'complex128',
137+
'float32',
138+
'float64',
139+
'int16',
140+
'int32',
141+
'int8',
142+
'uint16',
143+
'uint32',
144+
'uint8',
145+
'uint8c',
146+
'generic'
147+
];
148+
actual = dtypes( 'typed_and_generic' );
149+
150+
t.deepEqual( actual, expected, 'returns expected value' );
151+
t.end();
152+
});
153+
107154
tape( 'the function supports returning a list of floating-point array data types', function test( t ) {
108155
var expected;
109156
var actual;

typed-complex-dtypes/README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,9 @@ Returns a list of complex typed array data types.
4646

4747
```javascript
4848
var out = dtypes();
49-
// returns [ 'complex64', 'complex128' ]
49+
// e.g., returns [ 'complex64', ... ]
5050
```
5151

52-
The output `array` contains the following data types:
53-
54-
- `complex64`: single-precision floating-point complex numbers.
55-
- `complex128`: double-precision floating-point complex numbers.
56-
5752
</section>
5853

5954
<!-- /.usage -->
@@ -79,7 +74,6 @@ var indexOf = require( '@stdlib/utils/index-of' );
7974
var dtypes = require( '@stdlib/array/typed-complex-dtypes' );
8075

8176
var DTYPES = dtypes();
82-
var bool;
8377

8478
function isdtype( str ) {
8579
if ( indexOf( DTYPES, str ) === -1 ) {
@@ -88,7 +82,7 @@ function isdtype( str ) {
8882
return true;
8983
}
9084

91-
bool = isdtype( 'complex64' );
85+
var bool = isdtype( 'complex64' );
9286
// returns true
9387

9488
bool = isdtype( 'complex128' );

typed-complex-dtypes/benchmark/benchmark.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ bench( pkg, function benchmark( b ) {
3535
b.tic();
3636
for ( i = 0; i < b.iterations; i++ ) {
3737
out = dtypes();
38-
if ( out.length !== 2 ) {
39-
b.fail( 'should return an array of length 2' );
38+
if ( out.length < 2 ) {
39+
b.fail( 'should return an array' );
4040
}
4141
}
4242
b.toc();

typed-complex-dtypes/docs/repl.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
{{alias}}()
33
Returns a list of complex typed array data types.
44

5-
The output array contains the following data types:
6-
7-
- complex64: single-precision floating-point complex numbers.
8-
- complex128: double-precision floating-point complex numbers.
9-
105
Returns
116
-------
127
out: Array<string>

typed-complex-dtypes/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { ComplexFloatingPointDataType as DataType } from '@stdlib/types/array';
2929
*
3030
* @example
3131
* var list = dtypes();
32-
* // returns [ 'complex64', 'complex128' ]
32+
* // e.g., returns [ 'complex64', ... ]
3333
*/
3434
declare function dtypes(): Array<DataType>;
3535

typed-complex-dtypes/examples/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ var indexOf = require( '@stdlib/utils/index-of' );
2222
var dtypes = require( './../lib' );
2323

2424
var DTYPES = dtypes();
25-
var bool;
2625

2726
function isdtype( str ) {
2827
if ( indexOf( DTYPES, str ) === -1 ) {
@@ -31,7 +30,7 @@ function isdtype( str ) {
3130
return true;
3231
}
3332

34-
bool = isdtype( 'complex64' );
33+
var bool = isdtype( 'complex64' );
3534
console.log( bool );
3635
// => true
3736

typed-complex-dtypes/lib/dtypes.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

typed-complex-dtypes/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* var dtypes = require( '@stdlib/array/typed-complex-dtypes' );
2828
*
2929
* var list = dtypes();
30-
* // returns [ 'complex64', 'complex128' ]
30+
* // e.g., returns [ 'complex64', ... ]
3131
*/
3232

3333
// MODULES //

typed-complex-dtypes/lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
// MODULES //
2222

23-
var DTYPES = require( './dtypes.json' );
23+
var dt = require( './../../dtypes' );
2424

2525

2626
// MAIN //
@@ -32,10 +32,10 @@ var DTYPES = require( './dtypes.json' );
3232
*
3333
* @example
3434
* var list = dtypes();
35-
* // returns [ 'complex64', 'complex128' ]
35+
* // e.g., returns [ 'complex64', ... ]
3636
*/
3737
function dtypes() {
38-
return DTYPES.slice();
38+
return dt( 'complex_floating_point' );
3939
}
4040

4141

typed-complex-dtypes/test/test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24+
var dt = require( './../../dtypes' );
2425
var dtypes = require( './../lib' );
2526

2627

@@ -36,10 +37,7 @@ tape( 'the function returns a list of complex typed array data types', function
3637
var expected;
3738
var actual;
3839

39-
expected = [
40-
'complex64',
41-
'complex128'
42-
];
40+
expected = dt( 'complex_floating_point' );
4341
actual = dtypes();
4442

4543
t.deepEqual( actual, expected, 'returns expected value' );

typed-dtypes/README.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,9 @@ Returns a list of typed array data types.
4646

4747
```javascript
4848
var out = dtypes();
49-
// e.g., returns [ 'float32', 'float64', 'int16', 'int32', 'int8', 'uint16', 'uint32', 'uint8', 'uint8c', 'complex128', 'complex64' ]
49+
// e.g., returns [ 'float32', ... ]
5050
```
5151

52-
The output `array` contains the following data types:
53-
54-
- `float32`: single-precision floating-point numbers.
55-
- `float64`: double-precision floating-point numbers.
56-
- `complex64`: single-precision complex floating-point numbers.
57-
- `complex128`: double-precision complex floating-point numbers.
58-
- `int16`: signed 16-bit integers.
59-
- `int32`: signed 32-bit integers.
60-
- `int8`: signed 8-bit integers.
61-
- `uint16`: unsigned 16-bit integers.
62-
- `uint32`: unsigned 32-bit integers.
63-
- `uint8`: unsigned 8-bit integers.
64-
- `uint8c`: unsigned clamped 8-bit integers.
65-
6652
</section>
6753

6854
<!-- /.usage -->

typed-dtypes/docs/repl.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,6 @@
22
{{alias}}()
33
Returns a list of typed array data types.
44

5-
The output array contains the following data types:
6-
7-
- float32: single-precision floating-point numbers.
8-
- float64: double-precision floating-point numbers.
9-
- complex64: single-precision complex floating-point numbers.
10-
- complex128: double-precision complex floating-point numbers.
11-
- int16: signed 16-bit integers.
12-
- int32: signed 32-bit integers.
13-
- int8: signed 8-bit integers.
14-
- uint16: unsigned 16-bit integers.
15-
- uint32: unsigned 32-bit integers.
16-
- uint8: unsigned 8-bit integers.
17-
- uint8c: unsigned clamped 8-bit integers.
18-
195
Returns
206
-------
217
out: Array<string>

typed-dtypes/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { NumericDataType as DataType } from '@stdlib/types/array';
23+
import { TypedDataType as DataType } from '@stdlib/types/array';
2424

2525
/**
2626
* Returns a list of typed array data types.
@@ -29,7 +29,7 @@ import { NumericDataType as DataType } from '@stdlib/types/array';
2929
*
3030
* @example
3131
* var list = dtypes();
32-
* // e.g., returns [ 'float32', 'float64', 'int16', 'int32', 'int8', 'uint16', 'uint32', 'uint8', 'uint8c', 'complex128', 'complex64' ]
32+
* // e.g., returns [ 'float32', ... ]
3333
*/
3434
declare function dtypes(): Array<DataType>;
3535

typed-dtypes/docs/types/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import dtypes = require( './index' );
2323

2424
// The function returns a string array..
2525
{
26-
dtypes(); // $ExpectType NumericDataType[]
26+
dtypes(); // $ExpectType TypedDataType[]
2727
}
2828

2929
// The compiler throws an error if the function is provided arguments...

typed-dtypes/lib/dtypes.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

typed-dtypes/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* var dtypes = require( '@stdlib/array/typed-dtypes' );
2828
*
2929
* var list = dtypes();
30-
* // e.g., returns [ 'float32', 'float64', 'int16', 'int32', 'int8', 'uint16', 'uint32', 'uint8', 'uint8c', 'complex128', 'complex64' ]
30+
* // e.g., returns [ 'float32', ... ]
3131
*/
3232

3333
// MODULES //

typed-dtypes/lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
// MODULES //
2222

23-
var DTYPES = require( './dtypes.json' );
23+
var dt = require( './../../dtypes' );
2424

2525

2626
// MAIN //
@@ -32,10 +32,10 @@ var DTYPES = require( './dtypes.json' );
3232
*
3333
* @example
3434
* var list = dtypes();
35-
* // e.g., returns [ 'float32', 'float64', 'int16', 'int32', 'int8', 'uint16', 'uint32', 'uint8', 'uint8c', 'complex128', 'complex64' ]
35+
* // e.g., returns [ 'float32', ... ]
3636
*/
3737
function dtypes() {
38-
return DTYPES.slice();
38+
return dt( 'typed' );
3939
}
4040

4141

typed-dtypes/test/test.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24+
var dt = require( './../../dtypes' );
2425
var dtypes = require( './../lib' );
2526

2627

@@ -36,19 +37,7 @@ tape( 'the function returns a list of typed array data types', function test( t
3637
var expected;
3738
var actual;
3839

39-
expected = [
40-
'float32',
41-
'float64',
42-
'int16',
43-
'int32',
44-
'int8',
45-
'uint16',
46-
'uint32',
47-
'uint8',
48-
'uint8c',
49-
'complex64',
50-
'complex128'
51-
];
40+
expected = dt( 'typed' );
5241
actual = dtypes();
5342

5443
t.deepEqual( actual, expected, 'returns expected value' );

typed-float-dtypes/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,9 @@ Returns a list of typed array floating-point data types.
4646

4747
```javascript
4848
var out = dtypes();
49-
// e.g., returns [ 'float32', 'float64', 'complex64', 'complex128' ]
49+
// e.g., returns [ 'float32', ... ]
5050
```
5151

52-
The output `array` contains the following data types:
53-
54-
- `float32`: single-precision floating-point numbers.
55-
- `float64`: double-precision floating-point numbers.
56-
- `complex64`: single-precision complex floating-point numbers.
57-
- `complex128`: double-precision complex floating-point numbers.
58-
5952
</section>
6053

6154
<!-- /.usage -->

0 commit comments

Comments
 (0)