Skip to content

Commit 728bfae

Browse files
committed
Auto-generated commit
1 parent dc9f922 commit 728bfae

File tree

3 files changed

+26
-23
lines changed

3 files changed

+26
-23
lines changed

CHANGELOG.md

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

7-
## Unreleased (2025-08-12)
7+
## Unreleased (2025-08-27)
88

99
<section class="bug-fixes">
1010

@@ -22,6 +22,7 @@
2222

2323
<details>
2424

25+
- [`c4cc264`](https://github.com/stdlib-js/stdlib/commit/c4cc264996ce9f4241476c857c4c985fb6612c84) - **docs:** update markup _(by Athan Reines)_
2526
- [`77867ac`](https://github.com/stdlib-js/stdlib/commit/77867ac1767a186023f633dea30ddf860962aaed) - **docs:** remove trailing whitespace _(by Philipp Burckhardt)_
2627
- [`ed2d89f`](https://github.com/stdlib-js/stdlib/commit/ed2d89f2c0c0950bfb6fad6375296173a7aee0b9) - **refactor:** use base assertion utility _(by Athan Reines)_
2728
- [`b9d3f03`](https://github.com/stdlib-js/stdlib/commit/b9d3f03a8fc45fa0f65dc1ded1a5b40125a0a0fb) - **refactor:** use base assertion utility _(by Athan Reines)_

CONTRIBUTORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ Ruthwik Chikoti <145591715+ruthwikchikoti@users.noreply.github.com>
166166
Ryan Seal <splrk@users.noreply.github.com>
167167
Rylan Yang <137365285+rylany27@users.noreply.github.com>
168168
SAHIL KUMAR <168997976+sahilk45@users.noreply.github.com>
169+
SAUJANYA MAGARDE <162047941+SaujanyaMagarde@users.noreply.github.com>
169170
SHIVAM YADAV <120725381+Shivam-1827@users.noreply.github.com>
170171
Sachin Raj <120590207+schnrj@users.noreply.github.com>
171172
Sahil Goyal <87982509+sahil20021008@users.noreply.github.com>
@@ -188,6 +189,7 @@ Sivam Das <100067002+Sivam2313@users.noreply.github.com>
188189
Snehil Shah <snehilshah.989@gmail.com>
189190
Soumajit Chatterjee <121816890+soumajit23@users.noreply.github.com>
190191
Spandan Barve <contact@marsian.dev>
192+
Srinivas Batthula <srinivasbatthula05.official@gmail.com>
191193
Stephannie Jiménez Gacha <steff456@hotmail.com>
192194
Suhaib Ilahi <suhaib.elahi87@gmail.com>
193195
Suraj Kumar <125961509+kumarsuraj212003@users.noreply.github.com>

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ var arr = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] );
8787

8888
To initialize multidimensional array data, provide a `buffer` argument, which may be a [generic array][@stdlib/array/generic], [typed array][@stdlib/array/typed], [Buffer][@stdlib/buffer/ctor], or [ndarray][@stdlib/ndarray/ctor].
8989

90-
<!-- eslint-disable object-curly-spacing, object-curly-newline -->
90+
<!-- eslint-disable object-curly-spacing, object-curly-newline, stdlib/line-closing-bracket-spacing -->
9191

9292
```javascript
9393
var Float64Array = require( '@stdlib/array-float64' );
@@ -110,54 +110,54 @@ arr = array( array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ) );
110110
// returns <ndarray>
111111
```
112112

113-
The function accepts the following `options`:
113+
The function accepts the following options:
114114

115115
- **buffer**: data source. If provided along with a `buffer` argument, the argument takes precedence.
116116

117-
- **dtype**: underlying storage [data type][@stdlib/ndarray/dtypes]. If not specified and a data source is provided, the data type is inferred from the provided data source. If an input data source is not of the same type, this option specifies the data type to which to cast the input data. For non-[`ndarray`][@stdlib/ndarray/ctor] generic array data sources, the function casts generic array data elements to the default data type. In order to prevent this cast, the `dtype` option **must** be explicitly set to `'generic'`. Any time a cast is required, the `copy` option is set to `true`, as memory must be copied from the data source to an output data buffer. Default: `'float64'`.
117+
- **dtype**: underlying storage [data type][@stdlib/ndarray/dtypes]. If not specified and a data source is provided, the data type is inferred from the provided data source. If an input data source is not of the same type, this option specifies the data type to which to cast the input data. For non-[ndarray][@stdlib/ndarray/ctor] generic array data sources, the function casts generic array data elements to the default data type. In order to prevent this cast, the `dtype` option **must** be explicitly set to `'generic'`. Any time a cast is required, the `copy` option is set to `true`, as memory must be copied from the data source to an output data buffer. Default: `'float64'`.
118118

119119
- **order**: specifies the memory layout of the data source as either row-major (C-style) or column-major (Fortran-style). The option may be one of the following values:
120120

121-
- `row-major`: the order of the returned array is row-major.
122-
- `column-major`: the order of the returned array is column-major.
123-
- `any`: if a data source is column-major and not row-major, the order of the returned array is column-major; otherwise, the order of the returned array is row-major.
124-
- `same`: the order of the returned array matches the order of an input data source.
121+
- `'row-major'`: the order of the returned array is row-major.
122+
- `'column-major'`: the order of the returned array is column-major.
123+
- `'any'`: if a data source is column-major and not row-major, the order of the returned array is column-major; otherwise, the order of the returned array is row-major.
124+
- `'same'`: the order of the returned array matches the order of an input data source.
125125

126126
Note that specifying an order which differs from the order of a provided data source does **not** entail a conversion from one memory layout to another. In short, this option is descriptive, not prescriptive. Default: `'row-major'`.
127127

128128
- **shape**: array shape (dimensions). If a shape is not specified, the function attempts to infer a shape based on a provided data source. For example, if provided a nested array, the function resolves nested array dimensions. If provided a multidimensional array data source, the function uses the array's associated shape. For most use cases, such inference suffices. For the remaining use cases, specifying a shape is necessary. For example, provide a shape to create a multidimensional array view over a linear data buffer, ignoring any existing shape meta data associated with a provided data source.
129129

130-
- **flatten**: `boolean` indicating whether to automatically flatten generic array data sources. If an array shape is not specified, the shape is inferred from the dimensions of nested arrays prior to flattening. If a use case requires partial flattening, partially flatten **prior** to invoking this function and set the option value to `false` to prevent further flattening during invocation. Default: `true`.
130+
- **flatten**: boolean indicating whether to automatically flatten generic array data sources. If an array shape is not specified, the shape is inferred from the dimensions of nested arrays prior to flattening. If a use case requires partial flattening, partially flatten **prior** to invoking this function and set the option value to `false` to prevent further flattening during invocation. Default: `true`.
131131

132-
- **copy**: `boolean` indicating whether to (shallow) copy source data to a new data buffer. The function does **not** perform a deep copy. To prevent undesired shared changes in state for generic arrays containing objects, perform a deep copy **prior** to invoking this function. Default: `false`.
132+
- **copy**: boolean indicating whether to (shallow) copy source data to a new data buffer. The function does **not** perform a deep copy. To prevent undesired shared changes in state for generic arrays containing objects, perform a deep copy **prior** to invoking this function. Default: `false`.
133133

134134
- **ndmin**: specifies the minimum number of dimensions. If an array shape has fewer dimensions than required by `ndmin`, the function **prepends** singleton dimensions to the array shape in order to satisfy the dimensions requirement. Default: `0`.
135135

136136
- **casting**: specifies the casting rule used to determine acceptable casts. The option may be one of the following values:
137137

138-
- `none`: only allow casting between identical types.
139-
- `equiv`: allow casting between identical and byte swapped types.
140-
- `safe`: only allow "safe" casts.
141-
- `mostly-safe`: allow "safe" casts and, for floating-point data types, downcasts.
142-
- `same-kind`: allow "safe" casts and casts within the same kind (e.g., between signed integers or between floats).
143-
- `unsafe`: allow casting between all types (including between integers and floats).
138+
- `'none'`: only allow casting between identical types.
139+
- `'equiv'`: allow casting between identical and byte swapped types.
140+
- `'safe'`: only allow "safe" casts.
141+
- `'mostly-safe'`: allow "safe" casts and, for floating-point data types, downcasts.
142+
- `'same-kind'`: allow "safe" casts and casts within the same kind (e.g., between signed integers or between floats).
143+
- `'unsafe'`: allow casting between all types (including between integers and floats).
144144

145145
Default: `'safe'`.
146146

147147
- **mode**: specifies how to handle indices which exceed array dimensions.
148148

149-
- `throw`: specifies that an [`ndarray`][@stdlib/ndarray/ctor] instance should throw an error when an index exceeds array dimensions.
150-
- `normalize`: specifies that an [`ndarray`][@stdlib/ndarray/ctor] instance should normalize negative indices and throw an error when an index exceeds array dimensions.
151-
- `wrap`: specifies that an [`ndarray`][@stdlib/ndarray/ctor] instance should wrap around an index exceeding array dimensions using modulo arithmetic.
152-
- `clamp`: specifies that an [`ndarray`][@stdlib/ndarray/ctor] instance should set an index exceeding array dimensions to either `0` (minimum index) or the maximum index.
149+
- `'throw'`: specifies that an [ndarray][@stdlib/ndarray/ctor] instance should throw an error when an index exceeds array dimensions.
150+
- `'normalize'`: specifies that an [ndarray][@stdlib/ndarray/ctor] instance should normalize negative indices and throw an error when an index exceeds array dimensions.
151+
- `'wrap'`: specifies that an [ndarray][@stdlib/ndarray/ctor] instance should wrap around an index exceeding array dimensions using modulo arithmetic.
152+
- `'clamp'`: specifies that an [ndarray][@stdlib/ndarray/ctor] instance should set an index exceeding array dimensions to either `0` (minimum index) or the maximum index.
153153

154154
Default: `'throw'`.
155155

156156
- **submode**: a mode array which specifies for each dimension how to handle subscripts which exceed array dimensions. If provided fewer modes than dimensions, the function recycles modes using modulo arithmetic. Default: `[ options.mode ]`.
157157

158-
- **readonly**: `boolean` indicating whether an [`ndarray`][@stdlib/ndarray/ctor] instance should be **read-only**. Default: `false`.
158+
- **readonly**: boolean indicating whether an [ndarray][@stdlib/ndarray/ctor] instance should be **read-only**. Default: `false`.
159159

160-
By default, an [`ndarray`][@stdlib/ndarray/ctor] instance **throws** when provided an index which exceeds array dimensions. To support alternative indexing behavior, set the `mode` option, which will affect all public methods for getting and setting array elements.
160+
By default, an [ndarray][@stdlib/ndarray/ctor] instance **throws** when provided an index which exceeds array dimensions. To support alternative indexing behavior, set the `mode` option, which will affect all public methods for getting and setting array elements.
161161

162162
```javascript
163163
var opts = {
@@ -222,7 +222,7 @@ var bool = ( v === buf[ 0 ] );
222222

223223
## Notes
224224

225-
- The number of elements in a data source `buffer` **must** agree with a specified array `shape` (i.e., the function assumes a single-segment contiguous [`ndarray`][@stdlib/ndarray/ctor]). To create arbitrary multidimensional views over linear data buffers, use a [lower-level constructor][@stdlib/ndarray/ctor].
225+
- The number of elements in a data source `buffer` **must** agree with a specified array shape (i.e., the function assumes a single-segment contiguous [ndarray][@stdlib/ndarray/ctor]). To create arbitrary multidimensional views over linear data buffers, use a [lower-level constructor][@stdlib/ndarray/ctor].
226226
- The function supports arbitrary casting between data types. Note, however, that casting from a larger data type to a smaller data type (e.g., `int32` to `int8`) and between signed and unsigned types of the same size should be considered **unsafe**.
227227

228228
</section>

0 commit comments

Comments
 (0)