diff --git a/dtypes/README.md b/dtypes/README.md index 951f4926..df05abcf 100644 --- a/dtypes/README.md +++ b/dtypes/README.md @@ -82,6 +82,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. diff --git a/dtypes/docs/repl.txt b/dtypes/docs/repl.txt index 3aa86a0c..e653135c 100644 --- a/dtypes/docs/repl.txt +++ b/dtypes/docs/repl.txt @@ -2,23 +2,6 @@ {{alias}}( [kind] ) Returns a list of ndarray data types. - When not provided a data type "kind", the function returns an array - containing the following data types: - - - binary: binary. - - complex64: single-precision complex floating-point numbers. - - complex128: double-precision complex floating-point numbers. - - float32: single-precision floating-point numbers. - - float64: double-precision floating-point numbers. - - generic: values of any type. - - 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. - The function supports the following data type "kinds": - floating_point: floating-point data types. @@ -29,6 +12,7 @@ - unsigned_integer: unsigned integer data types. - real: real-valued data types. - numeric: numeric data types. + - typed: typed data types. - all: all data types. Parameters diff --git a/dtypes/docs/types/index.d.ts b/dtypes/docs/types/index.d.ts index 0be69220..5acfbc4a 100644 --- a/dtypes/docs/types/index.d.ts +++ b/dtypes/docs/types/index.d.ts @@ -25,24 +25,6 @@ import { DataType, DataTypeKind } from '@stdlib/types/ndarray'; /** * Returns a list of ndarray data types. * -* ## Notes -* -* - When not provided a data type "kind", the function returns an array containing the following data types: -* -* - `binary`: binary. -* - `complex64`: single-precision complex floating-point numbers. -* - `complex128`: double-precision complex floating-point numbers. -* - `float32`: single-precision floating-point numbers. -* - `float64`: double-precision floating-point numbers. -* - `generic`: values of any type. -* - `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. -* * @param kind - data type kind * @returns list of ndarray data types * diff --git a/dtypes/lib/dtypes.json b/dtypes/lib/dtypes.json index 5fc61b32..d9aacf23 100644 --- a/dtypes/lib/dtypes.json +++ b/dtypes/lib/dtypes.json @@ -14,6 +14,20 @@ "uint8", "uint8c" ], + "typed": [ + "binary", + "complex64", + "complex128", + "float32", + "float64", + "int16", + "int32", + "int8", + "uint16", + "uint32", + "uint8", + "uint8c" + ], "floating_point": [ "complex64", "complex128", diff --git a/dtypes/test/test.js b/dtypes/test/test.js index 09078339..863ded24 100644 --- a/dtypes/test/test.js +++ b/dtypes/test/test.js @@ -105,6 +105,30 @@ tape( 'the function supports returning a list of ndarray data types (all)', func t.end(); }); +tape( 'the function supports returning a list of ndarray data types (typed)', function test( t ) { + var expected; + var actual; + + expected = [ + 'binary', + '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 floating-point ndarray data types', function test( t ) { var expected; var actual;