Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Feb 7, 2024
1 parent cdded38 commit 32f25ef
Show file tree
Hide file tree
Showing 69 changed files with 146 additions and 318 deletions.
1 change: 1 addition & 0 deletions dtypes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ The function supports the following data type kinds:
- `unsigned_integer`: unsigned integer data types.
- `real`: real-valued data types.
- `numeric`: numeric data types.
- `typed`: typed data types.
- `all`: all data types.

Additionally, the function supports extending the "kinds" listed above by appending an `_and_generic` suffix to the kind name (e.g., `real_and_generic`).
Expand Down
1 change: 1 addition & 0 deletions dtypes/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- unsigned_integer: unsigned integer data types.
- real: real-valued data types.
- numeric: numeric data types.
- typed: "typed" data types.
- all: all data types.

Additionally, the function supports extending the "kinds" listed above by
Expand Down
13 changes: 13 additions & 0 deletions dtypes/lib/dtypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@
"uint8",
"uint8c"
],
"typed": [
"complex64",
"complex128",
"float32",
"float64",
"int16",
"int32",
"int8",
"uint16",
"uint32",
"uint8",
"uint8c"
],
"floating_point": [
"complex64",
"complex128",
Expand Down
47 changes: 47 additions & 0 deletions dtypes/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,53 @@ tape( 'the function supports returning a list of array data types (all, includin
t.end();
});

tape( 'the function supports returning a list of array data types (typed)', function test( t ) {
var expected;
var actual;

expected = [
'complex64',
'complex128',
'float32',
'float64',
'int16',
'int32',
'int8',
'uint16',
'uint32',
'uint8',
'uint8c'
];
actual = dtypes( 'typed' );

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

tape( 'the function supports returning a list of array data types (typed, including "generic")', function test( t ) {
var expected;
var actual;

expected = [
'complex64',
'complex128',
'float32',
'float64',
'int16',
'int32',
'int8',
'uint16',
'uint32',
'uint8',
'uint8c',
'generic'
];
actual = dtypes( 'typed_and_generic' );

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

tape( 'the function supports returning a list of floating-point array data types', function test( t ) {
var expected;
var actual;
Expand Down
10 changes: 2 additions & 8 deletions typed-complex-dtypes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,9 @@ Returns a list of complex typed array data types.

```javascript
var out = dtypes();
// returns [ 'complex64', 'complex128' ]
// e.g., returns [ 'complex64', ... ]
```

The output `array` contains the following data types:

- `complex64`: single-precision floating-point complex numbers.
- `complex128`: double-precision floating-point complex numbers.

</section>

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

var DTYPES = dtypes();
var bool;

function isdtype( str ) {
if ( indexOf( DTYPES, str ) === -1 ) {
Expand All @@ -88,7 +82,7 @@ function isdtype( str ) {
return true;
}

bool = isdtype( 'complex64' );
var bool = isdtype( 'complex64' );
// returns true

bool = isdtype( 'complex128' );
Expand Down
4 changes: 2 additions & 2 deletions typed-complex-dtypes/benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ bench( pkg, function benchmark( b ) {
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
out = dtypes();
if ( out.length !== 2 ) {
b.fail( 'should return an array of length 2' );
if ( out.length < 2 ) {
b.fail( 'should return an array' );
}
}
b.toc();
Expand Down
5 changes: 0 additions & 5 deletions typed-complex-dtypes/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
{{alias}}()
Returns a list of complex typed array data types.

The output array contains the following data types:

- complex64: single-precision floating-point complex numbers.
- complex128: double-precision floating-point complex numbers.

Returns
-------
out: Array<string>
Expand Down
2 changes: 1 addition & 1 deletion typed-complex-dtypes/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { ComplexFloatingPointDataType as DataType } from '@stdlib/types/array';
*
* @example
* var list = dtypes();
* // returns [ 'complex64', 'complex128' ]
* // e.g., returns [ 'complex64', ... ]
*/
declare function dtypes(): Array<DataType>;

Expand Down
3 changes: 1 addition & 2 deletions typed-complex-dtypes/examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ var indexOf = require( '@stdlib/utils/index-of' );
var dtypes = require( './../lib' );

var DTYPES = dtypes();
var bool;

function isdtype( str ) {
if ( indexOf( DTYPES, str ) === -1 ) {
Expand All @@ -31,7 +30,7 @@ function isdtype( str ) {
return true;
}

bool = isdtype( 'complex64' );
var bool = isdtype( 'complex64' );
console.log( bool );
// => true

Expand Down
4 changes: 0 additions & 4 deletions typed-complex-dtypes/lib/dtypes.json

This file was deleted.

2 changes: 1 addition & 1 deletion typed-complex-dtypes/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* var dtypes = require( '@stdlib/array/typed-complex-dtypes' );
*
* var list = dtypes();
* // returns [ 'complex64', 'complex128' ]
* // e.g., returns [ 'complex64', ... ]
*/

// MODULES //
Expand Down
6 changes: 3 additions & 3 deletions typed-complex-dtypes/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// MODULES //

var DTYPES = require( './dtypes.json' );
var dt = require( './../../dtypes' );


// MAIN //
Expand All @@ -32,10 +32,10 @@ var DTYPES = require( './dtypes.json' );
*
* @example
* var list = dtypes();
* // returns [ 'complex64', 'complex128' ]
* // e.g., returns [ 'complex64', ... ]
*/
function dtypes() {
return DTYPES.slice();
return dt( 'complex_floating_point' );
}


Expand Down
6 changes: 2 additions & 4 deletions typed-complex-dtypes/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// MODULES //

var tape = require( 'tape' );
var dt = require( './../../dtypes' );
var dtypes = require( './../lib' );


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

expected = [
'complex64',
'complex128'
];
expected = dt( 'complex_floating_point' );
actual = dtypes();

t.deepEqual( actual, expected, 'returns expected value' );
Expand Down
16 changes: 1 addition & 15 deletions typed-dtypes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,9 @@ Returns a list of typed array data types.

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

The output `array` contains the following data types:

- `float32`: single-precision floating-point numbers.
- `float64`: double-precision floating-point numbers.
- `complex64`: single-precision complex floating-point numbers.
- `complex128`: double-precision complex floating-point numbers.
- `int16`: signed 16-bit integers.
- `int32`: signed 32-bit integers.
- `int8`: signed 8-bit integers.
- `uint16`: unsigned 16-bit integers.
- `uint32`: unsigned 32-bit integers.
- `uint8`: unsigned 8-bit integers.
- `uint8c`: unsigned clamped 8-bit integers.

</section>

<!-- /.usage -->
Expand Down
14 changes: 0 additions & 14 deletions typed-dtypes/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@
{{alias}}()
Returns a list of typed array data types.

The output array contains the following data types:

- float32: single-precision floating-point numbers.
- float64: double-precision floating-point numbers.
- complex64: single-precision complex floating-point numbers.
- complex128: double-precision complex floating-point numbers.
- int16: signed 16-bit integers.
- int32: signed 32-bit integers.
- int8: signed 8-bit integers.
- uint16: unsigned 16-bit integers.
- uint32: unsigned 32-bit integers.
- uint8: unsigned 8-bit integers.
- uint8c: unsigned clamped 8-bit integers.

Returns
-------
out: Array<string>
Expand Down
4 changes: 2 additions & 2 deletions typed-dtypes/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

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

import { NumericDataType as DataType } from '@stdlib/types/array';
import { TypedDataType as DataType } from '@stdlib/types/array';

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

Expand Down
2 changes: 1 addition & 1 deletion typed-dtypes/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import dtypes = require( './index' );

// The function returns a string array..
{
dtypes(); // $ExpectType NumericDataType[]
dtypes(); // $ExpectType TypedDataType[]
}

// The compiler throws an error if the function is provided arguments...
Expand Down
13 changes: 0 additions & 13 deletions typed-dtypes/lib/dtypes.json

This file was deleted.

2 changes: 1 addition & 1 deletion typed-dtypes/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* var dtypes = require( '@stdlib/array/typed-dtypes' );
*
* var list = dtypes();
* // e.g., returns [ 'float32', 'float64', 'int16', 'int32', 'int8', 'uint16', 'uint32', 'uint8', 'uint8c', 'complex128', 'complex64' ]
* // e.g., returns [ 'float32', ... ]
*/

// MODULES //
Expand Down
6 changes: 3 additions & 3 deletions typed-dtypes/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// MODULES //

var DTYPES = require( './dtypes.json' );
var dt = require( './../../dtypes' );


// MAIN //
Expand All @@ -32,10 +32,10 @@ var DTYPES = require( './dtypes.json' );
*
* @example
* var list = dtypes();
* // e.g., returns [ 'float32', 'float64', 'int16', 'int32', 'int8', 'uint16', 'uint32', 'uint8', 'uint8c', 'complex128', 'complex64' ]
* // e.g., returns [ 'float32', ... ]
*/
function dtypes() {
return DTYPES.slice();
return dt( 'typed' );
}


Expand Down
15 changes: 2 additions & 13 deletions typed-dtypes/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// MODULES //

var tape = require( 'tape' );
var dt = require( './../../dtypes' );
var dtypes = require( './../lib' );


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

expected = [
'float32',
'float64',
'int16',
'int32',
'int8',
'uint16',
'uint32',
'uint8',
'uint8c',
'complex64',
'complex128'
];
expected = dt( 'typed' );
actual = dtypes();

t.deepEqual( actual, expected, 'returns expected value' );
Expand Down
9 changes: 1 addition & 8 deletions typed-float-dtypes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,9 @@ Returns a list of typed array floating-point data types.

```javascript
var out = dtypes();
// e.g., returns [ 'float32', 'float64', 'complex64', 'complex128' ]
// e.g., returns [ 'float32', ... ]
```

The output `array` contains the following data types:

- `float32`: single-precision floating-point numbers.
- `float64`: double-precision floating-point numbers.
- `complex64`: single-precision complex floating-point numbers.
- `complex128`: double-precision complex floating-point numbers.

</section>

<!-- /.usage -->
Expand Down
Loading

0 comments on commit 32f25ef

Please sign in to comment.