Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Dec 17, 2024
1 parent 4637105 commit c0d11b0
Show file tree
Hide file tree
Showing 15 changed files with 1,422 additions and 9 deletions.
52 changes: 51 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<section class="release" id="unreleased">

## Unreleased (2024-12-16)
## Unreleased (2024-12-17)

<section class="packages">

Expand All @@ -20,6 +20,7 @@

##### Features

- [`9d912a3`](https://github.com/stdlib-js/stdlib/commit/9d912a3e992cb9c5fe272a3aecc55293efbc0647) - add `ndarray2json` to namespace
- [`1a202e3`](https://github.com/stdlib-js/stdlib/commit/1a202e3605b10cd01bf9654f8356c72c5c8a8186) - update namespace TypeScript declarations [(#3916)](https://github.com/stdlib-js/stdlib/pull/3916)
- [`dbfd8f5`](https://github.com/stdlib-js/stdlib/commit/dbfd8f5c81d11be2142ebfc4f2f0bb0316ba7478) - add `filterMap` to namespace
- [`cbc4d3f`](https://github.com/stdlib-js/stdlib/commit/cbc4d3f7514b7213cad4f9d2ca5d916e13eeffa5) - add `reject` to namespace
Expand Down Expand Up @@ -58,6 +59,7 @@

##### Features

- [`58e795d`](https://github.com/stdlib-js/stdlib/commit/58e795db467b7bd1d3dc6c5847f91a97fed2ccff) - update namespace TypeScript declarations [(#3937)](https://github.com/stdlib-js/stdlib/pull/3937)
- [`14427c7`](https://github.com/stdlib-js/stdlib/commit/14427c79bc62f82b16cbadc9d34749901e48d105) - add `fill`, `map`, and `toReversed` to namespace
- [`a0d6619`](https://github.com/stdlib-js/stdlib/commit/a0d66193409576538d0f16aa89cbaeedec7898be) - add `minSignedIntegerDataType` and `minUnsignedIntegerDataType` to namespace
- [`8b1548f`](https://github.com/stdlib-js/stdlib/commit/8b1548fb45c1ff131f5edac20cb984344a2d28ec) - update namespace TypeScript declarations [(#3190)](https://github.com/stdlib-js/stdlib/pull/3190)
Expand Down Expand Up @@ -118,6 +120,28 @@

<!-- /.package -->

<section class="package" id="ndarray-base-ctor-unreleased">

#### [@stdlib/ndarray/base/ctor](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/ctor)

<details>

<section class="bug-fixes">

##### Bug Fixes

- [`aea44c9`](https://github.com/stdlib-js/stdlib/commit/aea44c9c8699a4d748c0db70d4a60801bfc03c40) - update loop limit

</section>

<!-- /.bug-fixes -->

</details>

</section>

<!-- /.package -->

<section class="package" id="ndarray-base-map-unreleased">

#### [@stdlib/ndarray/base/map](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/map)
Expand Down Expand Up @@ -350,6 +374,28 @@

<!-- /.package -->

<section class="package" id="ndarray-to-json-unreleased">

#### [@stdlib/ndarray/to-json](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/to-json)

<details>

<section class="features">

##### Features

- [`ae80da2`](https://github.com/stdlib-js/stdlib/commit/ae80da29fdbfd1be7541df6607715b77b06f1019) - add `ndarray/to-json`

</section>

<!-- /.features -->

</details>

</section>

<!-- /.package -->

</section>

<!-- /.packages -->
Expand Down Expand Up @@ -386,6 +432,10 @@ A total of 3 people contributed to this release. Thank you to the following cont

<details>

- [`9d912a3`](https://github.com/stdlib-js/stdlib/commit/9d912a3e992cb9c5fe272a3aecc55293efbc0647) - **feat:** add `ndarray2json` to namespace _(by Athan Reines)_
- [`ae80da2`](https://github.com/stdlib-js/stdlib/commit/ae80da29fdbfd1be7541df6607715b77b06f1019) - **feat:** add `ndarray/to-json` _(by Athan Reines)_
- [`aea44c9`](https://github.com/stdlib-js/stdlib/commit/aea44c9c8699a4d748c0db70d4a60801bfc03c40) - **fix:** update loop limit _(by Athan Reines)_
- [`58e795d`](https://github.com/stdlib-js/stdlib/commit/58e795db467b7bd1d3dc6c5847f91a97fed2ccff) - **feat:** update namespace TypeScript declarations [(#3937)](https://github.com/stdlib-js/stdlib/pull/3937) _(by stdlib-bot, Philipp Burckhardt)_
- [`c106b69`](https://github.com/stdlib-js/stdlib/commit/c106b69cc141efc8c32e79d55ad8acf07f3c9c0a) - **docs:** update namespace table of contents [(#3939)](https://github.com/stdlib-js/stdlib/pull/3939) _(by stdlib-bot, Philipp Burckhardt)_
- [`58f02bf`](https://github.com/stdlib-js/stdlib/commit/58f02bf605d6879cd80152f11f913451df2ad494) - **docs:** fix comment _(by Athan Reines)_
- [`baffefb`](https://github.com/stdlib-js/stdlib/commit/baffefb25177147fa3bafa5c1d0562a7528d5054) - **docs:** fix comment _(by Athan Reines)_
Expand Down
15 changes: 8 additions & 7 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
#
# Contributors listed in alphabetical order.

Aadish Jain <[email protected]>
Aayush Khanna <[email protected]>
Abhijit Raut <[email protected]>
Adarsh Palaskar <[email protected]>
Aditya Sapra <[email protected]>
Ahmed Atwa <[email protected]>
Ahmed Kashkoush <[email protected]>
Ahmed Khaled <[email protected]>
Aleksandr <[email protected]>
Ali Salesi <[email protected]>
Aman Bhansali <[email protected]>
Expand Down Expand Up @@ -46,11 +48,10 @@ Jordan Gallivan <[email protected]>
Joris Labie <[email protected]>
Justin Dennison <[email protected]>
Karthik Prakash <[email protected]>
Khaldon <[email protected]>
Kohantika Nath <[email protected]>
Krishnendu Das <[email protected]>
Kshitij-Dale <[email protected]>
Lovelin <[email protected]>
Lovelin Dhoni J B <[email protected]>
Manik Sharma <[email protected]>
Manvith M <[email protected]>
Marcus Fantham <[email protected]>
Expand All @@ -61,6 +62,7 @@ Mohammad Kaif <[email protected]>
Momtchil Momtchev <[email protected]>
Muhammad Haris <[email protected]>
Naresh Jagadeesan <[email protected]>
Naveen Kumar <[email protected]>
Neeraj Pathak <[email protected]>
Nishant Shinde <[email protected]>
Nithin Katta <[email protected]>
Expand All @@ -71,10 +73,10 @@ Ori Miles <[email protected]>
Philipp Burckhardt <[email protected]>
Prajwal Kulkarni <[email protected]>
Pranav Goswami <[email protected]>
Praneki <[email protected]>
Pratik <[email protected]>
Pranjal Jha <[email protected]>
Pratik Singh <[email protected]>
Pratyush Kumar Chouhan <[email protected]>
Priyansh <[email protected]>
Priyansh Prajapati <[email protected]>
Priyanshu Agarwal <[email protected]>
Pushpendra Chandravanshi <[email protected]>
Raunak Kumar Gupta <[email protected]>
Expand All @@ -93,7 +95,7 @@ Sarthak Paandey <[email protected]>
Saurabh Singh <[email protected]>
Seyyed Parsa Neshaei <[email protected]>
Shashank Shekhar Singh <[email protected]>
Shivam <[email protected]>
Shivam Ahir <[email protected]>
Shraddheya Shendre <[email protected]>
Shubh Mehta <[email protected]>
Shubham Mishra <[email protected]>
Expand All @@ -116,7 +118,6 @@ Vivek maurya <[email protected]>
Xiaochuan Ye <[email protected]>
Yaswanth Kosuru <[email protected]>
Yernar Yergaziyev <[email protected]>
naveen <[email protected]>
olenkabilonizhka <[email protected]>
rainn <[email protected]>
rei2hu <[email protected]>
2 changes: 1 addition & 1 deletion base/ctor/lib/tojson.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function toJSON() {
out.strides = this._strides.slice();

// Flip the signs of negative strides:
for ( i = 0; i < len; i++ ) {
for ( i = 0; i < out.strides.length; i++ ) {
if ( out.strides[ i ] < 0 ) {
out.strides[ i ] *= -1;
}
Expand Down
155 changes: 155 additions & 0 deletions base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import dtypes2signatures = require( './../../../base/dtypes2signatures' );
import empty = require( './../../../base/empty' );
import emptyLike = require( './../../../base/empty-like' );
import expandDimensions = require( './../../../base/expand-dimensions' );
import fill = require( './../../../base/fill' );
import flag = require( './../../../base/flag' );
import flags = require( './../../../base/flags' );
import fliplr = require( './../../../base/fliplr' );
Expand All @@ -59,10 +60,13 @@ import scalar2ndarray = require( './../../../base/from-scalar' );
import ind = require( './../../../base/ind' );
import ind2sub = require( './../../../base/ind2sub' );
import iterationOrder = require( './../../../base/iteration-order' );
import map = require( './../../../base/map' );
import maxViewBufferIndex = require( './../../../base/max-view-buffer-index' );
import maybeBroadcastArray = require( './../../../base/maybe-broadcast-array' );
import maybeBroadcastArrays = require( './../../../base/maybe-broadcast-arrays' );
import metaDataProps = require( './../../../base/meta-data-props' );
import minSignedIntegerDataType = require( './../../../base/min-signed-integer-dtype' );
import minUnsignedIntegerDataType = require( './../../../base/min-unsigned-integer-dtype' );
import minViewBufferIndex = require( './../../../base/min-view-buffer-index' );
import minmaxViewBufferIndex = require( './../../../base/minmax-view-buffer-index' );
import ndarraylike2ndarray = require( './../../../base/ndarraylike2ndarray' );
Expand Down Expand Up @@ -103,6 +107,7 @@ import strides2offset = require( './../../../base/strides2offset' );
import strides2order = require( './../../../base/strides2order' );
import sub2ind = require( './../../../base/sub2ind' );
import ndarray2array = require( './../../../base/to-array' );
import toReversed = require( './../../../base/to-reversed' );
import transpose = require( './../../../base/transpose' );
import unary = require( './../../../base/unary' );
import unaryBy = require( './../../../base/unary-by' );
Expand Down Expand Up @@ -938,6 +943,44 @@ interface Namespace {
*/
expandDimensions: typeof expandDimensions;

/**
* Fills an input ndarray with a specified value.
*
* @param x - input ndarray
* @param value - scalar value
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* // Create a data buffer:
* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
*
* // Define the shape of the input array:
* var shape = [ 3, 1, 2 ];
*
* // Define the array strides:
* var sx = [ 2, 2, 1 ];
*
* // Define the index offset:
* var ox = 0;
*
* // Create the input ndarray-like object:
* var x = {
* 'dtype': 'float64',
* 'data': xbuf,
* 'shape': shape,
* 'strides': sx,
* 'offset': ox,
* 'order': 'row-major'
* };
*
* ns.fill( x, 10.0 );
*
* console.log( x.data );
* // => <Float64Array>[ 10.0, 10.0, 10.0, 10.0, 10.0, 10.0 ]
*/
fill: typeof fill;

/**
* Returns a specified flag for a provided ndarray.
*
Expand Down Expand Up @@ -1291,6 +1334,50 @@ interface Namespace {
*/
iterationOrder: typeof iterationOrder;

/**
* Applies a callback function to the elements in an input ndarray and assigns results to the elements in an output ndarray.
*
* @param arrays - array-like object containing one input ndarray and one output ndarray
* @param fcn - callback function
* @param thisArg - callback function execution context
* @throws arrays must have the same number of dimensions
* @throws arrays must have the same shape
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var ndarray = require( './../../../ctor' );
*
* function scale( x ) {
* return x * 10.0;
* }
*
* // Create data buffers:
* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
* var ybuf = new Float64Array( 6 );
*
* // Define the shape of the input and output arrays:
* var shape = [ 3, 1, 2 ];
*
* // Define the array strides:
* var sx = [ 4, 4, 1 ];
* var sy = [ 2, 2, 1 ];
*
* // Define the index offsets:
* var ox = 1;
* var oy = 0;
*
* // Create the input and output ndarrays:
* var x = ndarray( 'float64', xbuf, shape, sx, ox, 'row-major' );
* var y = ndarray( 'float64', ybuf, shape, sy, oy, 'row-major' );
*
* // Apply the ns.map function:
* ns.map( [ x, y ], scale );
*
* console.log( y.data );
* // => <Float64Array>[ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]
*/
map: typeof map;

/**
* Computes the maximum linear index in an underlying data buffer accessible to an array view.
*
Expand Down Expand Up @@ -1484,6 +1571,38 @@ interface Namespace {
*/
metaDataProps: typeof metaDataProps;

/**
* Returns the minimum ndarray data type for storing a provided signed integer value.
*
* @param value - scalar value
* @returns ndarray data type
*
* @example
* var dt = ns.minSignedIntegerDataType( 1280 );
* // returns 'int16'
*
* @example
* var dt = ns.minSignedIntegerDataType( 3 );
* // returns 'int8'
*/
minSignedIntegerDataType: typeof minSignedIntegerDataType;

/**
* Returns the minimum ndarray data type for storing a provided unsigned integer value.
*
* @param value - scalar value
* @returns ndarray data type
*
* @example
* var dt = ns.minUnsignedIntegerDataType( 1280 );
* // returns 'uint16'
*
* @example
* var dt = ns.minUnsignedIntegerDataType( 3 );
* // returns 'uint8'
*/
minUnsignedIntegerDataType: typeof minUnsignedIntegerDataType;

/**
* Computes the minimum linear index in an underlying data buffer accessible to an array view.
*
Expand Down Expand Up @@ -2718,6 +2837,42 @@ interface Namespace {
*/
ndarray2array: typeof ndarray2array;

/**
* Returns a new ndarray where the order of elements of an input ndarray is reversed along each dimension.
*
* @param x - input array
* @returns output array
*
* @example
* var typedarray = require( '@stdlib/array/typed' );
* var ndarray = require( './../../../ctor' );
* var ndarray2array = require( './../../../to-array' );
*
* var buffer = typedarray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], 'float64' );
* var shape = [ 3, 2 ];
* var strides = [ 2, 1 ];
* var offset = 0;
*
* var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' );
* // returns <ndarray>
*
* var sh = x.shape;
* // returns [ 3, 2 ]
*
* var arr = ndarray2array( x );
* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
*
* var y = ns.toReversed( x );
* // returns <ndarray>
*
* sh = y.shape;
* // returns [ 3, 2 ]
*
* arr = ndarray2array( y );
* // returns [ [ 6.0, 5.0 ], [ 4.0, 3.0 ], [ 2.0, 1.0 ] ]
*/
toReversed: typeof toReversed;

/**
* Transposes a matrix (or a stack of matrices).
*
Expand Down
9 changes: 9 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,15 @@ setReadOnly( ns, 'sub2ind', require( './../sub2ind' ) );
*/
setReadOnly( ns, 'ndarray2array', require( './../to-array' ) );

/**
* @name ndarray2json
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/ndarray/to-json}
*/
setReadOnly( ns, 'ndarray2json', require( './../to-json' ) );

/**
* @name zeros
* @memberof ns
Expand Down
Loading

0 comments on commit c0d11b0

Please sign in to comment.