Skip to content

Commit 301fb39

Browse files
committed
Auto-generated commit
1 parent 6903486 commit 301fb39

File tree

13 files changed

+1469
-1
lines changed

13 files changed

+1469
-1
lines changed

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-11-03)
7+
## Unreleased (2025-11-04)
88

99
<section class="features">
1010

1111
### Features
1212

13+
- [`a07dba7`](https://github.com/stdlib-js/stdlib/commit/a07dba7671e5c34b32277a26e8f2aa014f0868b4) - add `nullaryStrided1dDispatchFactory` to namespace
14+
- [`c2512eb`](https://github.com/stdlib-js/stdlib/commit/c2512eb60c1fea33fa164753e784a9ab3bd57451) - add `some` to namespace
15+
- [`8a3e72b`](https://github.com/stdlib-js/stdlib/commit/8a3e72b3478beaf05ef0f18326c6403debc51827) - add `shift` to namespace
16+
- [`8932249`](https://github.com/stdlib-js/stdlib/commit/8932249481c46eedb61ffc6e822560824ce26060) - add `pop` to namespace
17+
- [`c2ec9e2`](https://github.com/stdlib-js/stdlib/commit/c2ec9e21057480aa045e006da6c78babbeb29eee) - add `flattenShapeFrom` to namespace
18+
- [`136a4f7`](https://github.com/stdlib-js/stdlib/commit/136a4f78781b449c5c333f79768f6452c3084163) - add `dtypeAlignment` to namespace
19+
- [`9125dc2`](https://github.com/stdlib-js/stdlib/commit/9125dc20850e80b80ef9afbd6431b932b2924cef) - add `copy` to namespace
20+
- [`2b62970`](https://github.com/stdlib-js/stdlib/commit/2b62970851dfbb69e2c2d94ecb098fa741bc6617) - add `dtypeChars` to namespace
21+
- [`d5cb7ec`](https://github.com/stdlib-js/stdlib/commit/d5cb7ec32e06766b70f0c057472977a01c6643f1) - add `ndarray/base/dtype-chars`
1322
- [`1a6e701`](https://github.com/stdlib-js/stdlib/commit/1a6e701ed9749678827c69b83d4780bd96d78015) - add `ndarray/concat` [(#7969)](https://github.com/stdlib-js/stdlib/pull/7969)
1423
- [`dcafcbc`](https://github.com/stdlib-js/stdlib/commit/dcafcbc6ddad41e4cd12d46dad426fe80bf7eab3) - add `ndarray/base/some` [(#7653)](https://github.com/stdlib-js/stdlib/pull/7653)
1524
- [`f8c51b3`](https://github.com/stdlib-js/stdlib/commit/f8c51b3a7653d158c23babe3b0986bb20b8b4029) - add `ndarray/find` [(#4398)](https://github.com/stdlib-js/stdlib/pull/4398)
@@ -444,6 +453,7 @@
444453

445454
### Bug Fixes
446455

456+
- [`ef3f025`](https://github.com/stdlib-js/stdlib/commit/ef3f025dad7f2b8a5a451b9cc3ec822cc66c1c2a) - address copy-paste mistake
447457
- [`186033e`](https://github.com/stdlib-js/stdlib/commit/186033e3cccf7faffaad1c101404de68f688027e) - address off-by-one bug
448458
- [`95313b8`](https://github.com/stdlib-js/stdlib/commit/95313b80fc669b87cf31298db9e03ff25cfdd312) - address off-by-one bug
449459
- [`c52126b`](https://github.com/stdlib-js/stdlib/commit/c52126b350f55f8d0b6a2622e367acdad9920dd6) - address off-by-one bug
@@ -611,6 +621,16 @@ A total of 31 issues were closed in this release:
611621

612622
<details>
613623

624+
- [`ef3f025`](https://github.com/stdlib-js/stdlib/commit/ef3f025dad7f2b8a5a451b9cc3ec822cc66c1c2a) - **fix:** address copy-paste mistake _(by Athan Reines)_
625+
- [`a07dba7`](https://github.com/stdlib-js/stdlib/commit/a07dba7671e5c34b32277a26e8f2aa014f0868b4) - **feat:** add `nullaryStrided1dDispatchFactory` to namespace _(by Athan Reines)_
626+
- [`c2512eb`](https://github.com/stdlib-js/stdlib/commit/c2512eb60c1fea33fa164753e784a9ab3bd57451) - **feat:** add `some` to namespace _(by Athan Reines)_
627+
- [`8a3e72b`](https://github.com/stdlib-js/stdlib/commit/8a3e72b3478beaf05ef0f18326c6403debc51827) - **feat:** add `shift` to namespace _(by Athan Reines)_
628+
- [`8932249`](https://github.com/stdlib-js/stdlib/commit/8932249481c46eedb61ffc6e822560824ce26060) - **feat:** add `pop` to namespace _(by Athan Reines)_
629+
- [`c2ec9e2`](https://github.com/stdlib-js/stdlib/commit/c2ec9e21057480aa045e006da6c78babbeb29eee) - **feat:** add `flattenShapeFrom` to namespace _(by Athan Reines)_
630+
- [`136a4f7`](https://github.com/stdlib-js/stdlib/commit/136a4f78781b449c5c333f79768f6452c3084163) - **feat:** add `dtypeAlignment` to namespace _(by Athan Reines)_
631+
- [`9125dc2`](https://github.com/stdlib-js/stdlib/commit/9125dc20850e80b80ef9afbd6431b932b2924cef) - **feat:** add `copy` to namespace _(by Athan Reines)_
632+
- [`2b62970`](https://github.com/stdlib-js/stdlib/commit/2b62970851dfbb69e2c2d94ecb098fa741bc6617) - **feat:** add `dtypeChars` to namespace _(by Athan Reines)_
633+
- [`d5cb7ec`](https://github.com/stdlib-js/stdlib/commit/d5cb7ec32e06766b70f0c057472977a01c6643f1) - **feat:** add `ndarray/base/dtype-chars` _(by Athan Reines)_
614634
- [`542bbf7`](https://github.com/stdlib-js/stdlib/commit/542bbf774737915ba7cd359d904e007239e397f6) - **refactor:** pass ndarray view to internal function _(by Athan Reines)_
615635
- [`1a6e701`](https://github.com/stdlib-js/stdlib/commit/1a6e701ed9749678827c69b83d4780bd96d78015) - **feat:** add `ndarray/concat` [(#7969)](https://github.com/stdlib-js/stdlib/pull/7969) _(by Muhammad Haris, Athan Reines, stdlib-bot)_
616636
- [`36fb4b9`](https://github.com/stdlib-js/stdlib/commit/36fb4b93d268a41fc21accf0af15fc815b00813e) - **docs:** update Markdown stdlib package URLs [(#8347)](https://github.com/stdlib-js/stdlib/pull/8347) _(by stdlib-bot)_

base/dtype-chars/README.md

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2025 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# dtypeChars
22+
23+
> List of ndarray data type single letter character abbreviations.
24+
25+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
26+
27+
<section class="intro">
28+
29+
</section>
30+
31+
<!-- /.intro -->
32+
33+
<!-- Package usage documentation. -->
34+
35+
<section class="usage">
36+
37+
## Usage
38+
39+
```javascript
40+
var dtypeChars = require( '@stdlib/ndarray/base/dtype-chars' );
41+
```
42+
43+
#### dtypeChars( \[kind] )
44+
45+
Returns a list of ndarray data type single letter character abbreviations.
46+
47+
```javascript
48+
var out = dtypeChars();
49+
// e.g., returns [ 'r', 'j', 'c', 'z', ... ]
50+
```
51+
52+
When not provided a data type "kind", the function returns an array containing the single letter character abbreviations for all support ndarray [data types][@stdlib/ndarray/dtypes]. To return the subset of data type single letter character abbreviations belonging to a specified data type kind, provide a `kind` argument.
53+
54+
```javascript
55+
var out = dtypeChars( 'floating_point' );
56+
// returns [...]
57+
```
58+
59+
The function supports the following data type kinds:
60+
61+
- `floating_point`: floating-point data types.
62+
- `real_floating_point`: real-valued floating-point data types.
63+
- `complex_floating_point`: complex-valued floating-point data types.
64+
- `boolean`: boolean data types.
65+
- `integer`: integer data types.
66+
- `signed_integer`: signed integer data types.
67+
- `unsigned_integer`: unsigned integer data types.
68+
- `real`: real-valued data types.
69+
- `numeric`: numeric data types.
70+
- `typed`: typed data types.
71+
- `integer_index`: integer index data types.
72+
- `boolean_index`: boolean index data types.
73+
- `mask_index`: mask index data types.
74+
- `typed_index`: typed index data types.
75+
- `index`: index data types.
76+
- `all`: all data types.
77+
78+
Additionally, the function supports extending the "kinds" listed above by appending an `_and_generic` suffix to the kind name (e.g., `real_and_generic`).
79+
80+
```javascript
81+
var out = dtypeChars( 'floating_point_and_generic' );
82+
// returns [...]
83+
```
84+
85+
</section>
86+
87+
<!-- /.usage -->
88+
89+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
90+
91+
<section class="notes">
92+
93+
</section>
94+
95+
<!-- /.notes -->
96+
97+
<!-- Package usage examples. -->
98+
99+
<section class="examples">
100+
101+
## Examples
102+
103+
<!-- eslint no-undef: "error" -->
104+
105+
```javascript
106+
var contains = require( '@stdlib/array/base/assert/contains' ).factory;
107+
var dtypeChars = require( '@stdlib/ndarray/base/dtype-chars' );
108+
109+
var isdtypeChar = contains( dtypeChars() );
110+
111+
var bool = isdtypeChar( 'd' );
112+
// returns true
113+
114+
bool = isdtypeChar( 'k' );
115+
// returns true
116+
117+
bool = isdtypeChar( 'b' );
118+
// returns true
119+
120+
bool = isdtypeChar( '~' );
121+
// returns false
122+
```
123+
124+
</section>
125+
126+
<!-- /.examples -->
127+
128+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
129+
130+
<section class="references">
131+
132+
</section>
133+
134+
<!-- /.references -->
135+
136+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
137+
138+
<section class="related">
139+
140+
</section>
141+
142+
<!-- /.related -->
143+
144+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
145+
146+
<section class="links">
147+
148+
[@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/ndarray/tree/main/dtypes
149+
150+
</section>
151+
152+
<!-- /.links -->
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var bench = require( '@stdlib/bench' );
24+
var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;
25+
var pkg = require( './../package.json' ).name;
26+
var dtypeChars = require( './../lib' );
27+
28+
29+
// MAIN //
30+
31+
bench( pkg, function benchmark( b ) {
32+
var out;
33+
var i;
34+
35+
b.tic();
36+
for ( i = 0; i < b.iterations; i++ ) {
37+
out = dtypeChars();
38+
if ( out.length === 0 ) {
39+
b.fail( 'should return a non-empty array' );
40+
}
41+
}
42+
b.toc();
43+
if ( !isStringArray( out ) ) {
44+
b.fail( 'should return an array of strings' );
45+
}
46+
b.pass( 'benchmark finished' );
47+
b.end();
48+
});
49+
50+
bench( pkg+'::kind', function benchmark( b ) {
51+
var values;
52+
var out;
53+
var i;
54+
55+
values = [
56+
'floating_point',
57+
'integer'
58+
];
59+
60+
b.tic();
61+
for ( i = 0; i < b.iterations; i++ ) {
62+
out = dtypeChars( values[ i%values.length ] );
63+
if ( out.length === 0 ) {
64+
b.fail( 'should return a non-empty array' );
65+
}
66+
}
67+
b.toc();
68+
if ( !isStringArray( out ) ) {
69+
b.fail( 'should return an array of strings' );
70+
}
71+
b.pass( 'benchmark finished' );
72+
b.end();
73+
});
74+
75+
bench( pkg+'::kind,generic', function benchmark( b ) {
76+
var values;
77+
var out;
78+
var i;
79+
80+
values = [
81+
'floating_point_and_generic',
82+
'integer_and_generic',
83+
'boolean_and_generic'
84+
];
85+
86+
b.tic();
87+
for ( i = 0; i < b.iterations; i++ ) {
88+
out = dtypeChars( values[ i%values.length ] );
89+
if ( out.length === 0 ) {
90+
b.fail( 'should return a non-empty array' );
91+
}
92+
}
93+
b.toc();
94+
if ( !isStringArray( out ) ) {
95+
b.fail( 'should return an array of strings' );
96+
}
97+
b.pass( 'benchmark finished' );
98+
b.end();
99+
});

base/dtype-chars/docs/repl.txt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
{{alias}}( [kind] )
3+
Returns a list of ndarray data type single letter character abbreviations.
4+
5+
When not provided a data type "kind", the function returns a list of single
6+
letter character abbreviations for all supported ndarray data types.
7+
8+
The function supports the following data type "kinds":
9+
10+
- floating_point: floating-point data types.
11+
- real_floating_point: real-valued floating-point data types.
12+
- complex_floating_point: complex-valued floating-point data types.
13+
- boolean: boolean data types.
14+
- integer: integer data types.
15+
- signed_integer: signed integer data types.
16+
- unsigned_integer: unsigned integer data types.
17+
- real: real-valued data types.
18+
- numeric: numeric data types.
19+
- typed: typed data types.
20+
- integer_index: integer index data types.
21+
- boolean_index: boolean index data types.
22+
- mask_index: mask index data types.
23+
- typed_index: typed index data types.
24+
- index: index data types.
25+
- all: all data types.
26+
27+
Additionally, the function supports extending the "kinds" listed above by
28+
appending a '_and_generic' suffix to the kind name (e.g., real_and_generic).
29+
30+
Parameters
31+
----------
32+
kind: string (optional)
33+
Data type kind.
34+
35+
Returns
36+
-------
37+
out: Array<string>
38+
List of ndarray data type single letter character abbreviations.
39+
40+
Examples
41+
--------
42+
> var out = {{alias}}()
43+
[...]
44+
> out = {{alias}}( 'floating_point' )
45+
[...]
46+
> out = {{alias}}( 'floating_point_and_generic' )
47+
[...]
48+
49+
See Also
50+
--------
51+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// TypeScript Version: 4.1
20+
21+
/// <reference types="@stdlib/types"/>
22+
23+
import { DataTypeKind } from '@stdlib/types/ndarray';
24+
25+
/**
26+
* Returns a list of ndarray data type single letter character abbreviations.
27+
*
28+
* @param kind - data type kind
29+
* @returns list of ndarray data type single letter character abbreviations
30+
*
31+
* @example
32+
* var list = dtypeChars();
33+
* // returns [...]
34+
*
35+
* @example
36+
* var list = dtypeChars( 'floating_point' );
37+
* // returns [...]
38+
*/
39+
declare function dtypeChars( kind?: DataTypeKind ): Array<string>;
40+
41+
42+
// EXPORTS //
43+
44+
export = dtypeChars;

0 commit comments

Comments
 (0)