Skip to content

Commit 5edbc25

Browse files
committed
feat: add index data type kinds
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 6606a96 commit 5edbc25

File tree

5 files changed

+176
-2
lines changed

5 files changed

+176
-2
lines changed

lib/node_modules/@stdlib/array/dtypes/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ The function supports the following data type kinds:
8484
- `real`: real-valued data types.
8585
- `numeric`: numeric data types.
8686
- `typed`: typed data types.
87+
- `integer_index`: integer index data types.
88+
- `boolean_index`: boolean index data types.
89+
- `mask_index`: mask index data types.
90+
- `typed_index`: typed index data types.
91+
- `index`: index data types.
8792
- `all`: all data types.
8893

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

lib/node_modules/@stdlib/array/dtypes/docs/repl.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@
3030
- unsigned_integer: unsigned integer data types.
3131
- real: real-valued data types.
3232
- numeric: numeric data types.
33-
- typed: "typed" data types.
33+
- typed: typed data types.
34+
- integer_index: integer index data types.
35+
- boolean_index: boolean index data types.
36+
- mask_index: mask index data types.
37+
- typed_index: typed index data types.
38+
- index: index data types.
3439
- all: all data types.
3540

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

lib/node_modules/@stdlib/array/dtypes/lib/dtypes.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,25 @@
8888
"uint32",
8989
"uint8",
9090
"uint8c"
91+
],
92+
"index": [
93+
"int32",
94+
"uint8",
95+
"bool",
96+
"generic"
97+
],
98+
"integer_index": [
99+
"int32"
100+
],
101+
"boolean_index": [
102+
"bool"
103+
],
104+
"mask_index": [
105+
"uint8"
106+
],
107+
"typed_index": [
108+
"int32",
109+
"uint8",
110+
"bool"
91111
]
92112
}

lib/node_modules/@stdlib/array/dtypes/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function dtypes() {
5656
kind = arguments[ 0 ];
5757
if ( RE_SUFFIX.test( kind ) ) {
5858
kind = replace( kind, RE_SUFFIX, '' );
59-
if ( kind !== 'all' ) {
59+
if ( kind !== 'all' && kind !== 'index' ) {
6060
FLG = true;
6161
}
6262
}

lib/node_modules/@stdlib/array/dtypes/test/test.js

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,150 @@ tape( 'the function supports returning a list of numeric array data types (inclu
467467
t.end();
468468
});
469469

470+
tape( 'the function supports returning a list of integer index array data types', function test( t ) {
471+
var expected;
472+
var actual;
473+
474+
expected = [
475+
'int32'
476+
];
477+
actual = dtypes( 'integer_index' );
478+
479+
t.deepEqual( actual, expected, 'returns expected value' );
480+
t.end();
481+
});
482+
483+
tape( 'the function supports returning a list of integer index array data types (including "generic")', function test( t ) {
484+
var expected;
485+
var actual;
486+
487+
expected = [
488+
'int32',
489+
'generic'
490+
];
491+
actual = dtypes( 'integer_index_and_generic' );
492+
493+
t.deepEqual( actual, expected, 'returns expected value' );
494+
t.end();
495+
});
496+
497+
tape( 'the function supports returning a list of boolean index array data types', function test( t ) {
498+
var expected;
499+
var actual;
500+
501+
expected = [
502+
'bool'
503+
];
504+
actual = dtypes( 'boolean_index' );
505+
506+
t.deepEqual( actual, expected, 'returns expected value' );
507+
t.end();
508+
});
509+
510+
tape( 'the function supports returning a list of boolean index array data types (including "generic")', function test( t ) {
511+
var expected;
512+
var actual;
513+
514+
expected = [
515+
'bool',
516+
'generic'
517+
];
518+
actual = dtypes( 'boolean_index_and_generic' );
519+
520+
t.deepEqual( actual, expected, 'returns expected value' );
521+
t.end();
522+
});
523+
524+
tape( 'the function supports returning a list of mask index array data types', function test( t ) {
525+
var expected;
526+
var actual;
527+
528+
expected = [
529+
'uint8'
530+
];
531+
actual = dtypes( 'mask_index' );
532+
533+
t.deepEqual( actual, expected, 'returns expected value' );
534+
t.end();
535+
});
536+
537+
tape( 'the function supports returning a list of mask index array data types (including "generic")', function test( t ) {
538+
var expected;
539+
var actual;
540+
541+
expected = [
542+
'uint8',
543+
'generic'
544+
];
545+
actual = dtypes( 'mask_index_and_generic' );
546+
547+
t.deepEqual( actual, expected, 'returns expected value' );
548+
t.end();
549+
});
550+
551+
tape( 'the function supports returning a list of typed index array data types', function test( t ) {
552+
var expected;
553+
var actual;
554+
555+
expected = [
556+
'int32',
557+
'uint8',
558+
'bool'
559+
];
560+
actual = dtypes( 'typed_index' );
561+
562+
t.deepEqual( actual, expected, 'returns expected value' );
563+
t.end();
564+
});
565+
566+
tape( 'the function supports returning a list of typed index array data types (including "generic")', function test( t ) {
567+
var expected;
568+
var actual;
569+
570+
expected = [
571+
'int32',
572+
'uint8',
573+
'bool',
574+
'generic'
575+
];
576+
actual = dtypes( 'typed_index_and_generic' );
577+
578+
t.deepEqual( actual, expected, 'returns expected value' );
579+
t.end();
580+
});
581+
582+
tape( 'the function supports returning a list of index array data types', function test( t ) {
583+
var expected;
584+
var actual;
585+
586+
expected = [
587+
'int32',
588+
'uint8',
589+
'bool',
590+
'generic'
591+
];
592+
actual = dtypes( 'index' );
593+
594+
t.deepEqual( actual, expected, 'returns expected value' );
595+
t.end();
596+
});
597+
598+
tape( 'the function supports returning a list of index array data types (including "generic")', function test( t ) {
599+
var expected;
600+
var actual;
601+
602+
expected = [
603+
'int32',
604+
'uint8',
605+
'bool',
606+
'generic'
607+
];
608+
actual = dtypes( 'index_and_generic' );
609+
610+
t.deepEqual( actual, expected, 'returns expected value' );
611+
t.end();
612+
});
613+
470614
tape( 'the function returns an empty array if provided an unrecognized data type kind', function test( t ) {
471615
t.deepEqual( dtypes( 'beep' ), [], 'returns expected value' );
472616
t.deepEqual( dtypes( 'beep_and_generic' ), [], 'returns expected value' );

0 commit comments

Comments
 (0)