Skip to content

Commit 61286dc

Browse files
committed
Auto-generated commit
1 parent 5254220 commit 61286dc

File tree

2 files changed

+44
-9
lines changed

2 files changed

+44
-9
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
<section class="release" id="unreleased">
66

7-
## Unreleased (2026-03-25)
7+
## Unreleased (2026-03-26)
88

99
<section class="features">
1010

1111
### Features
1212

13+
- [`4b2a4ab`](https://github.com/stdlib-js/stdlib/commit/4b2a4ab1c67f6ce6df86e03c93f3d7ccd9382b70) - update `ndarray` TypeScript declarations [(#11150)](https://github.com/stdlib-js/stdlib/pull/11150)
1314
- [`475f496`](https://github.com/stdlib-js/stdlib/commit/475f4962d86ed3c562800dce759c958a52e6a15e) - add `ones` to namespace
1415
- [`ded14cf`](https://github.com/stdlib-js/stdlib/commit/ded14cff1642c79ac122cc05b65e911cc24ec2ac) - add `ndarray/ones`
1516
- [`e00d73a`](https://github.com/stdlib-js/stdlib/commit/e00d73a3cb8c5355a46771ed5630d178e25ec0f4) - add `onesLike` to namespace
@@ -809,6 +810,7 @@ A total of 44 issues were closed in this release:
809810

810811
<details>
811812

813+
- [`4b2a4ab`](https://github.com/stdlib-js/stdlib/commit/4b2a4ab1c67f6ce6df86e03c93f3d7ccd9382b70) - **feat:** update `ndarray` TypeScript declarations [(#11150)](https://github.com/stdlib-js/stdlib/pull/11150) _(by stdlib-bot)_
812814
- [`475f496`](https://github.com/stdlib-js/stdlib/commit/475f4962d86ed3c562800dce759c958a52e6a15e) - **feat:** add `ones` to namespace _(by Athan Reines)_
813815
- [`ded14cf`](https://github.com/stdlib-js/stdlib/commit/ded14cff1642c79ac122cc05b65e911cc24ec2ac) - **feat:** add `ndarray/ones` _(by Athan Reines)_
814816
- [`bbd8f0e`](https://github.com/stdlib-js/stdlib/commit/bbd8f0eec8d6d52201d7706a349fdb9cac737d9c) - **refactor:** avoid unnecessary offset calculation _(by Athan Reines)_

docs/types/index.d.ts

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ import nextDataType = require( './../../next-dtype' );
8282
import numel = require( './../../numel' );
8383
import numelDimension = require( './../../numel-dimension' );
8484
import offset = require( './../../offset' );
85+
import ones = require( './../../ones' );
8586
import order = require( './../../order' );
8687
import orders = require( './../../orders' );
8788
import outputDataTypePolicies = require( './../../output-dtype-policies' );
@@ -1007,16 +1008,19 @@ interface Namespace {
10071008
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
10081009
* @param options.mode - specifies how to handle a linear index which exceeds array dimensions
10091010
* @param options.submode - specifies how to handle subscripts which exceed array dimensions on a per dimension basis
1010-
* @returns zero-filled array
1011+
* @returns output array
10111012
*
10121013
* @example
1014+
* var getShape = require( './../../shape' );
1015+
* var getDType = require( './../../dtype' );
1016+
*
10131017
* var arr = ns.empty( [ 2, 2 ] );
10141018
* // returns <ndarray>
10151019
*
1016-
* var sh = arr.shape;
1020+
* var sh = getShape( arr );
10171021
* // returns [ 2, 2 ]
10181022
*
1019-
* var dt = arr.dtype;
1023+
* var dt = String( getDType( arr ) );
10201024
* // returns 'float64'
10211025
*/
10221026
empty: typeof empty;
@@ -1034,26 +1038,28 @@ interface Namespace {
10341038
* @returns output array
10351039
*
10361040
* @example
1041+
* var getShape = require( './../../shape' );
1042+
* var getDType = require( './../../dtype' );
10371043
* var zeros = require( './../../zeros' );
10381044
*
10391045
* var x = zeros( [ 2, 2 ], {
10401046
* 'dtype': 'float64'
10411047
* });
1042-
* // returns <ndarray>
1048+
* // returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
10431049
*
1044-
* var sh = x.shape;
1050+
* var sh = getShape( x );
10451051
* // returns [ 2, 2 ]
10461052
*
1047-
* var dt = x.dtype;
1053+
* var dt = String( getDType( x ) );
10481054
* // returns 'float64'
10491055
*
10501056
* var y = ns.emptyLike( x );
10511057
* // returns <ndarray>
10521058
*
1053-
* sh = y.shape;
1059+
* sh = getShape( y );
10541060
* // returns [ 2, 2 ]
10551061
*
1056-
* dt = y.dtype;
1062+
* dt = String( getDType( y ) );
10571063
* // returns 'float64'
10581064
*/
10591065
emptyLike: typeof emptyLike;
@@ -2304,6 +2310,33 @@ interface Namespace {
23042310
*/
23052311
offset: typeof offset;
23062312

2313+
/**
2314+
* Creates a ones-filled array having a specified shape and data type.
2315+
*
2316+
* @param shape - array shape
2317+
* @param options - options
2318+
* @param options.dtype - underlying data type (default: 'float64')
2319+
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
2320+
* @param options.mode - specifies how to handle a linear index which exceeds array dimensions
2321+
* @param options.submode - specifies how to handle subscripts which exceed array dimensions on a per dimension basis
2322+
* @param options.readonly - boolean indicating whether an array should be read-only
2323+
* @returns ones-filled array
2324+
*
2325+
* @example
2326+
* var getShape = require( './../../shape' );
2327+
* var getDType = require( './../../dtype' );
2328+
*
2329+
* var arr = ns.ones( [ 2, 2 ] );
2330+
* // returns <ndarray>[ [ 1.0, 1.0 ], [ 1.0, 1.0 ] ]
2331+
*
2332+
* var sh = getShape( arr );
2333+
* // returns [ 2, 2 ]
2334+
*
2335+
* var dt = String( getDType( arr ) );
2336+
* // returns 'float64'
2337+
*/
2338+
ones: typeof ones;
2339+
23072340
/**
23082341
* Returns the layout order of a provided ndarray.
23092342
*

0 commit comments

Comments
 (0)