Skip to content

Commit bfff590

Browse files
committed
Auto-generated commit
1 parent bae525f commit bfff590

File tree

12 files changed

+1971
-1
lines changed

12 files changed

+1971
-1
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
### Features
1212

13+
- [`ba1c0f2`](https://github.com/stdlib-js/stdlib/commit/ba1c0f278e120cd42272fa2449bd13f045a469aa) - add `fillSlice` to namespace
14+
- [`f015917`](https://github.com/stdlib-js/stdlib/commit/f0159173d4db9e22bb1bd7c8b56c424b4d3e076e) - add `flattenBy` to namespace
15+
- [`8f440d7`](https://github.com/stdlib-js/stdlib/commit/8f440d7aeadc895a5a7a348e935389619d408a0e) - add `flatten` to namespace
16+
- [`c72e7c8`](https://github.com/stdlib-js/stdlib/commit/c72e7c87b41b3b9102a562928a43165e00b16f7b) - add `DataType` to namespace
17+
- [`8d411b1`](https://github.com/stdlib-js/stdlib/commit/8d411b127d3f42432f0fb1e91c7cccb7a61e848c) - add `ndarray/dtype-ctor`
1318
- [`44c2368`](https://github.com/stdlib-js/stdlib/commit/44c23684fef779a6e62dc18dd01192b192785a41) - add `ndarray/base/dtype-alignment`
1419
- [`6fe6a73`](https://github.com/stdlib-js/stdlib/commit/6fe6a7362f3e6cc18790ee1c4f7388cbce187cb3) - add `dtype` option support in `ndarray/flatten-by` [(#8094)](https://github.com/stdlib-js/stdlib/pull/8094)
1520
- [`0ed631d`](https://github.com/stdlib-js/stdlib/commit/0ed631d96dae3b796882c441f79505275afbc4c0) - add `dtype` option support in `ndarray/flatten` [(#8091)](https://github.com/stdlib-js/stdlib/pull/8091)
@@ -382,6 +387,7 @@
382387

383388
### Bug Fixes
384389

390+
- [`f8e5205`](https://github.com/stdlib-js/stdlib/commit/f8e520591bc2a8d8436ebb4fbe1604a7376105cd) - use correct `sliceAssign` alias
385391
- [`08c21f1`](https://github.com/stdlib-js/stdlib/commit/08c21f19a3dc1c7352e4760c19c1ec8aab714b54) - update return type
386392
- [`97d7e56`](https://github.com/stdlib-js/stdlib/commit/97d7e567e463ab9942c9d1188bc0c5786827e09b) - update return type
387393
- [`6f6da0a`](https://github.com/stdlib-js/stdlib/commit/6f6da0afaa12ef31691ae659f6a005f140d81cd1) - add missing argument to format strings
@@ -539,6 +545,12 @@ A total of 24 issues were closed in this release:
539545

540546
<details>
541547

548+
- [`ba1c0f2`](https://github.com/stdlib-js/stdlib/commit/ba1c0f278e120cd42272fa2449bd13f045a469aa) - **feat:** add `fillSlice` to namespace _(by Athan Reines)_
549+
- [`f015917`](https://github.com/stdlib-js/stdlib/commit/f0159173d4db9e22bb1bd7c8b56c424b4d3e076e) - **feat:** add `flattenBy` to namespace _(by Athan Reines)_
550+
- [`8f440d7`](https://github.com/stdlib-js/stdlib/commit/8f440d7aeadc895a5a7a348e935389619d408a0e) - **feat:** add `flatten` to namespace _(by Athan Reines)_
551+
- [`f8e5205`](https://github.com/stdlib-js/stdlib/commit/f8e520591bc2a8d8436ebb4fbe1604a7376105cd) - **fix:** use correct `sliceAssign` alias _(by Athan Reines)_
552+
- [`c72e7c8`](https://github.com/stdlib-js/stdlib/commit/c72e7c87b41b3b9102a562928a43165e00b16f7b) - **feat:** add `DataType` to namespace _(by Athan Reines)_
553+
- [`8d411b1`](https://github.com/stdlib-js/stdlib/commit/8d411b127d3f42432f0fb1e91c7cccb7a61e848c) - **feat:** add `ndarray/dtype-ctor` _(by Athan Reines)_
542554
- [`08c21f1`](https://github.com/stdlib-js/stdlib/commit/08c21f19a3dc1c7352e4760c19c1ec8aab714b54) - **fix:** update return type _(by Athan Reines)_
543555
- [`97d7e56`](https://github.com/stdlib-js/stdlib/commit/97d7e567e463ab9942c9d1188bc0c5786827e09b) - **fix:** update return type _(by Athan Reines)_
544556
- [`6f6da0a`](https://github.com/stdlib-js/stdlib/commit/6f6da0afaa12ef31691ae659f6a005f140d81cd1) - **fix:** add missing argument to format strings _(by Philipp Burckhardt)_

dtype-ctor/README.md

Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
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+
# DataType
22+
23+
> Data type constructor.
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 DataType = require( '@stdlib/ndarray/dtype-ctor' );
41+
```
42+
43+
#### DataType( value\[, options] )
44+
45+
Returns a data type instance.
46+
47+
```javascript
48+
var dt = new DataType( 'float64' );
49+
// returns <DataType>
50+
```
51+
52+
The constructor supports the following parameters:
53+
54+
- **value**: data type value. Must be either a supported [data type][@stdlib/ndarray/dtypes] string, a [struct][@stdlib/dstructs/struct] constructor, or another data type instance.
55+
- **options**: constructor options (_optional_).
56+
57+
The constructor supports the following options:
58+
59+
- **description**: data type description.
60+
61+
* * *
62+
63+
## Properties
64+
65+
#### DataType.prototype.alignment
66+
67+
Alignment (in bytes) for the data type.
68+
69+
```javascript
70+
var dt = new DataType( 'float64' );
71+
// returns <DataType>
72+
73+
var v = dt.alignment;
74+
// returns 8
75+
```
76+
77+
If a data type does not have a known alignment, the returned value is `-1`.
78+
79+
#### DataType.prototype.byteLength
80+
81+
Size (in bytes) for the data type.
82+
83+
```javascript
84+
var dt = new DataType( 'float64' );
85+
// returns <DataType>
86+
87+
var v = dt.byteLength;
88+
// returns 8
89+
```
90+
91+
If a data type does not have a known size, the returned value is `-1`.
92+
93+
#### DataType.prototype.byteOrder
94+
95+
Data type byte order.
96+
97+
```javascript
98+
var dt = new DataType( 'float64' );
99+
// returns <DataType>
100+
101+
var v = dt.byteOrder;
102+
// returns 'host'
103+
```
104+
105+
The byte order may be one of the following values:
106+
107+
- **host**: host platform byte order.
108+
- **little-endian**: little-endian byte order.
109+
- **big-endian**: big-endian byte order.
110+
111+
#### DataType.prototype.char
112+
113+
Single letter character abbreviation for the data type.
114+
115+
```javascript
116+
var dt = new DataType( 'float64' );
117+
// returns <DataType>
118+
119+
var v = dt.char;
120+
// returns 'd'
121+
```
122+
123+
If a data type does not have a corresponding single letter character abbreviation, the returned value is an empty string.
124+
125+
#### DataType.prototype.description
126+
127+
Data type description.
128+
129+
```javascript
130+
var dt = new DataType( 'float64' );
131+
// returns <DataType>
132+
133+
var v = dt.description;
134+
// returns '...'
135+
```
136+
137+
If a data type does not have an associated description, the returned value is an empty string.
138+
139+
#### DataType.prototype.enum
140+
141+
Enumeration constant for the data type.
142+
143+
```javascript
144+
var dt = new DataType( 'float64' );
145+
// returns <DataType>
146+
147+
var v = dt.enum;
148+
// returns <number>
149+
```
150+
151+
If a data type does not have a corresponding known enumeration constant, the returned value is the enumeration constant for a user-defined data type.
152+
153+
**Note**: enumeration constants should be treated as **opaque** values. One should **not** assume that a data type has a specific enumeration constant value.
154+
155+
#### DataType.prototype.value
156+
157+
Raw (original) data type value.
158+
159+
```javascript
160+
var dt = new DataType( 'float64' );
161+
// returns <DataType>
162+
163+
var v = dt.value;
164+
// returns 'float64'
165+
```
166+
167+
* * *
168+
169+
## Methods
170+
171+
#### DataType.prototype.toJSON()
172+
173+
Returns a [JSON][json] representation of a `DataType` instance.
174+
175+
```javascript
176+
var dt = new DataType( 'float64' );
177+
// returns <DataType>
178+
179+
var o = dt.toJSON();
180+
// e.g., returns { 'type': 'DataType', 'value': 'float64', 'byteOrder': 'host', ... }
181+
```
182+
183+
[`JSON.stringify()`][mdn-json-stringify] implicitly calls this method when stringifying a `DataType` instance.
184+
185+
#### DataType.prototype.toString()
186+
187+
Returns a string representation of a `DataType` instance.
188+
189+
```javascript
190+
var dt = new DataType( 'float64' );
191+
// returns <DataType>
192+
193+
var str = dt.toString();
194+
// returns 'float64'
195+
```
196+
197+
</section>
198+
199+
<!-- /.usage -->
200+
201+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
202+
203+
<section class="notes">
204+
205+
</section>
206+
207+
<!-- /.notes -->
208+
209+
* * *
210+
211+
<!-- Package usage examples. -->
212+
213+
<section class="examples">
214+
215+
## Examples
216+
217+
<!-- eslint no-undef: "error" -->
218+
219+
```javascript
220+
var DataType = require( '@stdlib/ndarray/dtype-ctor' );
221+
222+
var dt = new DataType( 'complex128' );
223+
224+
console.log( 'type: %s', typeof dt );
225+
// => 'type: object'
226+
227+
console.log( 'alignment: %d', dt.alignment );
228+
// => 'alignment: 8'
229+
230+
console.log( 'byteLength: %d', dt.byteLength );
231+
// => 'byteLength: 16'
232+
233+
console.log( 'byteOrder: %s', dt.byteOrder );
234+
// => 'byteOrder: host'
235+
236+
console.log( 'char: %s', dt.char );
237+
// => 'char: z'
238+
239+
console.log( 'JSON: %s', JSON.stringify( dt ) );
240+
// e.g., => 'JSON: {"type": "DataType","value":"float64","byteOrder":"host",...}'
241+
```
242+
243+
</section>
244+
245+
<!-- /.examples -->
246+
247+
<!-- 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. -->
248+
249+
<section class="references">
250+
251+
</section>
252+
253+
<!-- /.references -->
254+
255+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
256+
257+
<section class="related">
258+
259+
</section>
260+
261+
<!-- /.related -->
262+
263+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
264+
265+
<section class="links">
266+
267+
[json]: http://www.json.org/
268+
269+
[mdn-json-stringify]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
270+
271+
[@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/ndarray/tree/main/dtypes
272+
273+
[@stdlib/dstructs/struct]: https://github.com/stdlib-js/dstructs-struct
274+
275+
</section>
276+
277+
<!-- /.links -->

0 commit comments

Comments
 (0)