Skip to content

Commit 2b5e9f1

Browse files
committed
refactor: rename indexing to index and add specialized 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 6434c4c commit 2b5e9f1

File tree

5 files changed

+150
-8
lines changed

5 files changed

+150
-8
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ The function supports the following data type kinds:
8585
- `real`: real-valued data types.
8686
- `numeric`: numeric data types.
8787
- `typed`: typed data types.
88-
- `indexing`: ndarray index data types.
88+
- `integer_index`: integer index data types.
89+
- `boolean_index`: boolean index data types.
90+
- `mask_index`: mask index data types.
91+
- `typed_index`: typed index data types.
92+
- `index`: index data types.
8993
- `all`: all data types.
9094

9195
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/ndarray/dtypes/docs/repl.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
- real: real-valued data types.
3333
- numeric: numeric data types.
3434
- typed: typed data types.
35-
- indexing: ndarray index data types.
35+
- integer_index: integer index data types.
36+
- boolean_index: boolean index data types.
37+
- mask_index: mask index data types.
38+
- typed_index: typed index data types.
39+
- index: index data types.
3640
- all: all data types.
3741

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

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,24 @@
9191
"uint8",
9292
"uint8c"
9393
],
94-
"indexing": [
94+
"index": [
95+
"int32",
96+
"uint8",
97+
"bool",
98+
"generic"
99+
],
100+
"integer_index": [
95101
"int32"
102+
],
103+
"boolean_index": [
104+
"bool"
105+
],
106+
"mask_index": [
107+
"uint8"
108+
],
109+
"typed_index": [
110+
"int32",
111+
"uint8",
112+
"bool"
96113
]
97114
}

lib/node_modules/@stdlib/ndarray/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/ndarray/dtypes/test/test.js

Lines changed: 121 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,28 +497,145 @@ tape( 'the function supports returning a list of numeric ndarray data types (inc
497497
t.end();
498498
});
499499

500-
tape( 'the function supports returning a list of indexing ndarray data types', function test( t ) {
500+
tape( 'the function supports returning a list of integer index ndarray data types', function test( t ) {
501501
var expected;
502502
var actual;
503503

504504
expected = [
505505
'int32'
506506
];
507-
actual = dtypes( 'indexing' );
507+
actual = dtypes( 'integer_index' );
508508

509509
t.deepEqual( actual, expected, 'returns expected value' );
510510
t.end();
511511
});
512512

513-
tape( 'the function supports returning a list of indexing ndarray data types (including "generic")', function test( t ) {
513+
tape( 'the function supports returning a list of integer index ndarray data types (including "generic")', function test( t ) {
514514
var expected;
515515
var actual;
516516

517517
expected = [
518518
'int32',
519519
'generic'
520520
];
521-
actual = dtypes( 'indexing_and_generic' );
521+
actual = dtypes( 'integer_index_and_generic' );
522+
523+
t.deepEqual( actual, expected, 'returns expected value' );
524+
t.end();
525+
});
526+
527+
tape( 'the function supports returning a list of boolean index ndarray data types', function test( t ) {
528+
var expected;
529+
var actual;
530+
531+
expected = [
532+
'bool'
533+
];
534+
actual = dtypes( 'boolean_index' );
535+
536+
t.deepEqual( actual, expected, 'returns expected value' );
537+
t.end();
538+
});
539+
540+
tape( 'the function supports returning a list of boolean index ndarray data types (including "generic")', function test( t ) {
541+
var expected;
542+
var actual;
543+
544+
expected = [
545+
'bool',
546+
'generic'
547+
];
548+
actual = dtypes( 'boolean_index_and_generic' );
549+
550+
t.deepEqual( actual, expected, 'returns expected value' );
551+
t.end();
552+
});
553+
554+
tape( 'the function supports returning a list of mask index ndarray data types', function test( t ) {
555+
var expected;
556+
var actual;
557+
558+
expected = [
559+
'uint8'
560+
];
561+
actual = dtypes( 'mask_index' );
562+
563+
t.deepEqual( actual, expected, 'returns expected value' );
564+
t.end();
565+
});
566+
567+
tape( 'the function supports returning a list of mask index ndarray data types (including "generic")', function test( t ) {
568+
var expected;
569+
var actual;
570+
571+
expected = [
572+
'uint8',
573+
'generic'
574+
];
575+
actual = dtypes( 'mask_index_and_generic' );
576+
577+
t.deepEqual( actual, expected, 'returns expected value' );
578+
t.end();
579+
});
580+
581+
tape( 'the function supports returning a list of typed index ndarray data types', function test( t ) {
582+
var expected;
583+
var actual;
584+
585+
expected = [
586+
'int32',
587+
'uint8',
588+
'bool'
589+
];
590+
actual = dtypes( 'typed_index' );
591+
592+
t.deepEqual( actual, expected, 'returns expected value' );
593+
t.end();
594+
});
595+
596+
tape( 'the function supports returning a list of typed index ndarray data types (including "generic")', function test( t ) {
597+
var expected;
598+
var actual;
599+
600+
expected = [
601+
'int32',
602+
'uint8',
603+
'bool',
604+
'generic'
605+
];
606+
actual = dtypes( 'typed_index_and_generic' );
607+
608+
t.deepEqual( actual, expected, 'returns expected value' );
609+
t.end();
610+
});
611+
612+
tape( 'the function supports returning a list of index ndarray data types', function test( t ) {
613+
var expected;
614+
var actual;
615+
616+
expected = [
617+
'int32',
618+
'uint8',
619+
'bool',
620+
'generic'
621+
];
622+
actual = dtypes( 'index' );
623+
624+
t.deepEqual( actual, expected, 'returns expected value' );
625+
t.end();
626+
});
627+
628+
tape( 'the function supports returning a list of index ndarray data types (including "generic")', function test( t ) {
629+
var expected;
630+
var actual;
631+
632+
expected = [
633+
'int32',
634+
'uint8',
635+
'bool',
636+
'generic'
637+
];
638+
actual = dtypes( 'index_and_generic' );
522639

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

0 commit comments

Comments
 (0)