Skip to content

Commit d4c08ee

Browse files
committed
feat: add ndims to namespace
1 parent 94b7c2d commit d4c08ee

File tree

27 files changed

+39
-13
lines changed

27 files changed

+39
-13
lines changed

lib/node_modules/@stdlib/namespace/alias2pkg/data/data.csv

+1
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,7 @@ ndarraySafeCasts,"@stdlib/ndarray/safe-casts"
22872287
ndarraySameKindCasts,"@stdlib/ndarray/same-kind-casts"
22882288
ndempty,"@stdlib/ndarray/empty"
22892289
ndemptyLike,"@stdlib/ndarray/empty-like"
2290+
ndims,"@stdlib/ndarray/ndims"
22902291
nditer2arrayEach,"@stdlib/ndarray/iter/to-array-each"
22912292
nditerColumns,"@stdlib/ndarray/iter/columns"
22922293
nditerEntries,"@stdlib/ndarray/iter/entries"

lib/node_modules/@stdlib/namespace/alias2pkg/data/data.json

+1-1
Large diffs are not rendered by default.

lib/node_modules/@stdlib/namespace/alias2related/data/data.csv

+1
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,7 @@ ndarraySafeCasts,"ndarrayCastingModes,ndarrayDataTypes,ndarraySameKindCasts"
22872287
ndarraySameKindCasts,"ndarrayCastingModes,ndarrayDataTypes,ndarraySafeCasts"
22882288
ndempty,"ndemptyLike,ndzeros"
22892289
ndemptyLike,"ndempty,ndzerosLike"
2290+
ndims,"array,ndarray,numel"
22902291
nditer2arrayEach,"ndarray,ndarray2array"
22912292
nditerColumns,"nditerRows,ndslice"
22922293
nditerEntries,"ndarray,nditerIndices,nditerValues"

lib/node_modules/@stdlib/namespace/alias2related/data/data.json

+1-1
Large diffs are not rendered by default.

lib/node_modules/@stdlib/namespace/alias2standalone/data/data.csv

+1
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,7 @@ ndarraySafeCasts,"@stdlib/ndarray-safe-casts"
22872287
ndarraySameKindCasts,"@stdlib/ndarray-same-kind-casts"
22882288
ndempty,"@stdlib/ndarray-empty"
22892289
ndemptyLike,"@stdlib/ndarray-empty-like"
2290+
ndims,"@stdlib/ndarray-ndims"
22902291
nditer2arrayEach,"@stdlib/ndarray-iter-to-array-each"
22912292
nditerColumns,"@stdlib/ndarray-iter-columns"
22922293
nditerEntries,"@stdlib/ndarray-iter-entries"

lib/node_modules/@stdlib/namespace/alias2standalone/data/data.json

+1-1
Large diffs are not rendered by default.

lib/node_modules/@stdlib/namespace/aliases/data/data.json

+1-1
Large diffs are not rendered by default.

lib/node_modules/@stdlib/namespace/aliases/data/data.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,7 @@ ndarraySafeCasts
22872287
ndarraySameKindCasts
22882288
ndempty
22892289
ndemptyLike
2290+
ndims
22902291
nditer2arrayEach
22912292
nditerColumns
22922293
nditerEntries

lib/node_modules/@stdlib/namespace/lib/namespace/n.js

+13
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,19 @@ ns.push({
226226
]
227227
});
228228

229+
ns.push({
230+
'alias': 'ndims',
231+
'path': '@stdlib/ndarray/ndims',
232+
'value': require( '@stdlib/ndarray/ndims' ),
233+
'type': 'Function',
234+
'related': [
235+
'@stdlib/ndarray/array',
236+
'@stdlib/ndarray/ctor',
237+
'@stdlib/ndarray/numel',
238+
'@stdlib/ndarray/shape'
239+
]
240+
});
241+
229242
ns.push({
230243
'alias': 'nditer2arrayEach',
231244
'path': '@stdlib/ndarray/iter/to-array-each',

lib/node_modules/@stdlib/namespace/pkg2alias/data/data.csv

+1
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,7 @@
22872287
"@stdlib/ndarray/same-kind-casts",ndarraySameKindCasts
22882288
"@stdlib/ndarray/empty",ndempty
22892289
"@stdlib/ndarray/empty-like",ndemptyLike
2290+
"@stdlib/ndarray/ndims",ndims
22902291
"@stdlib/ndarray/iter/to-array-each",nditer2arrayEach
22912292
"@stdlib/ndarray/iter/columns",nditerColumns
22922293
"@stdlib/ndarray/iter/entries",nditerEntries

lib/node_modules/@stdlib/namespace/pkg2alias/data/data.json

+1-1
Large diffs are not rendered by default.

lib/node_modules/@stdlib/namespace/pkg2related/data/data.csv

+1
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,7 @@
22872287
"@stdlib/ndarray/same-kind-casts","@stdlib/ndarray/casting-modes,@stdlib/ndarray/dtypes,@stdlib/ndarray/safe-casts"
22882288
"@stdlib/ndarray/empty","@stdlib/ndarray/empty-like,@stdlib/ndarray/zeros"
22892289
"@stdlib/ndarray/empty-like","@stdlib/ndarray/empty,@stdlib/ndarray/zeros-like"
2290+
"@stdlib/ndarray/ndims","@stdlib/ndarray/array,@stdlib/ndarray/ctor,@stdlib/ndarray/numel"
22902291
"@stdlib/ndarray/iter/to-array-each","@stdlib/ndarray/ctor,@stdlib/ndarray/to-array"
22912292
"@stdlib/ndarray/iter/columns","@stdlib/ndarray/iter/rows,@stdlib/ndarray/slice"
22922293
"@stdlib/ndarray/iter/entries","@stdlib/ndarray/ctor,@stdlib/ndarray/iter/indices,@stdlib/ndarray/iter/values"

lib/node_modules/@stdlib/namespace/pkg2related/data/data.json

+1-1
Large diffs are not rendered by default.

lib/node_modules/@stdlib/namespace/pkg2standalone/data/data.csv

+1
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,7 @@
22872287
"@stdlib/ndarray/same-kind-casts","@stdlib/ndarray-same-kind-casts"
22882288
"@stdlib/ndarray/empty","@stdlib/ndarray-empty"
22892289
"@stdlib/ndarray/empty-like","@stdlib/ndarray-empty-like"
2290+
"@stdlib/ndarray/ndims","@stdlib/ndarray-ndims"
22902291
"@stdlib/ndarray/iter/to-array-each","@stdlib/ndarray-iter-to-array-each"
22912292
"@stdlib/ndarray/iter/columns","@stdlib/ndarray-iter-columns"
22922293
"@stdlib/ndarray/iter/entries","@stdlib/ndarray-iter-entries"

lib/node_modules/@stdlib/namespace/pkg2standalone/data/data.json

+1-1
Large diffs are not rendered by default.

lib/node_modules/@stdlib/namespace/standalone2pkg/data/data.csv

+1
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,7 @@
22872287
"@stdlib/ndarray-same-kind-casts","@stdlib/ndarray/same-kind-casts"
22882288
"@stdlib/ndarray-empty","@stdlib/ndarray/empty"
22892289
"@stdlib/ndarray-empty-like","@stdlib/ndarray/empty-like"
2290+
"@stdlib/ndarray-ndims","@stdlib/ndarray/ndims"
22902291
"@stdlib/ndarray-iter-to-array-each","@stdlib/ndarray/iter/to-array-each"
22912292
"@stdlib/ndarray-iter-columns","@stdlib/ndarray/iter/columns"
22922293
"@stdlib/ndarray-iter-entries","@stdlib/ndarray/iter/entries"

lib/node_modules/@stdlib/namespace/standalone2pkg/data/data.json

+1-1
Large diffs are not rendered by default.

lib/node_modules/@stdlib/repl/code-blocks/data/data.csv

+1
Original file line numberDiff line numberDiff line change
@@ -3712,6 +3712,7 @@ now,"var ts = now()\n"
37123712
NUM_CPUS,"NUM_CPUS\n"
37133713
num2words,"var out = num2words( 123 )\nout = num2words( 16.31 )\nout = num2words( 123, { 'lang': 'de' } )\n"
37143714
Number,"var v = new Number( 5 )\n"
3715+
numel,"var n = numel( ndzeros( [ 3, 3, 3 ] ) )\n"
37153716
numGraphemeClusters,"var out = numGraphemeClusters( 'beep' )\nout = numGraphemeClusters( '🌷' )\n"
37163717
Object,"var o = new Object( null )\no = new Object( 5.0 )\no = new Object( 'beep' )\n"
37173718
Object.assign,"var o = Object.assign( {}, { 'a': 1 }, { 'b': 2 } )\n"

lib/node_modules/@stdlib/repl/code-blocks/data/data.json

+1-1
Large diffs are not rendered by default.

lib/node_modules/@stdlib/repl/help/data/data.csv

+1
Original file line numberDiff line numberDiff line change
@@ -3679,6 +3679,7 @@ ndarraySafeCasts,"\nndarraySafeCasts( [dtype] )\n Returns a list of ndarray d
36793679
ndarraySameKindCasts,"\nndarraySameKindCasts( [dtype] )\n Returns a list of ndarray data types to which a provided ndarray data type\n can be safely cast or cast within the same \"kind\".\n\n If not provided an ndarray data type, the function returns a casting table.\n\n If provided an unrecognized ndarray data type, the function returns `null`.\n\n Parameters\n ----------\n dtype: any (optional)\n ndarray data type value.\n\n Returns\n -------\n out: Object|Array<string>|null\n ndarray data types to which a data type can be safely cast or cast\n within the same \"kind\".\n\n Examples\n --------\n > var out = ndarraySameKindCasts( 'float32' )\n <Array>\n\n See Also\n --------\n ndarrayCastingModes, ndarrayDataTypes, ndarraySafeCasts\n"
36803680
ndempty,"\nndempty( shape[, options] )\n Returns an uninitialized ndarray having a specified shape and data type.\n\n In browser environments, the function always returns zero-filled ndarrays.\n\n If `dtype` is 'generic', the function always returns a zero-filled ndarray.\n\n For returned ndarrays whose underlying memory is *not* initialized, memory\n contents are unknown and may contain *sensitive* data.\n\n Parameters\n ----------\n shape: ArrayLikeObject<integer>|integer\n Array shape.\n\n options: Object (optional)\n Options.\n\n options.dtype: string (optional)\n Underlying data type. Default: 'float64'.\n\n options.order: string (optional)\n Specifies whether an array is row-major (C-style) or column-major\n (Fortran-style). Default: 'row-major'.\n\n options.mode: string (optional)\n Specifies how to handle indices which exceed array dimensions. If equal\n to 'throw', an ndarray instance throws an error when an index exceeds\n array dimensions. If equal to 'wrap', an ndarray instance wraps around\n indices exceeding array dimensions using modulo arithmetic. If equal to\n 'clamp', an ndarray instance sets an index exceeding array dimensions to\n either `0` (minimum index) or the maximum index. Default: 'throw'.\n\n options.submode: Array<string> (optional)\n Specifies how to handle subscripts which exceed array dimensions. If a\n mode for a corresponding dimension is equal to 'throw', an ndarray\n instance throws an error when a subscript exceeds array dimensions. If\n equal to 'wrap', an ndarray instance wraps around subscripts exceeding\n array dimensions using modulo arithmetic. If equal to 'clamp', an\n ndarray instance sets a subscript exceeding array dimensions to either\n `0` (minimum index) or the maximum index. If the number of modes is\n fewer than the number of dimensions, the function recycles modes using\n modulo arithmetic. Default: [ options.mode ].\n\n Returns\n -------\n out: ndarray\n Output array.\n\n Examples\n --------\n > var arr = ndempty( [ 2, 2 ] )\n <ndarray>\n > var sh = arr.shape\n [ 2, 2 ]\n > var dt = arr.dtype\n 'float64'\n\n See Also\n --------\n ndemptyLike, ndzeros\n"
36813681
ndemptyLike,"\nndemptyLike( x[, options] )\n Returns an uninitialized ndarray having the same shape and data type as a\n provided input ndarray.\n\n The function infers the following attributes from the input array:\n\n - shape: array shape.\n - dtype: underlying array data type.\n - order: whether the array order is row-major (C-style) or column-major\n (Fortran-style).\n\n In browser environments, the function always returns zero-filled ndarrays.\n\n If `dtype` is 'generic', the function always returns a zero-filled ndarray.\n\n For returned ndarrays whose underlying memory is *not* initialized, memory\n contents are unknown and may contain *sensitive* data.\n\n Parameters\n ----------\n x: ndarray\n Input array.\n\n options: Object (optional)\n Options.\n\n options.shape: ArrayLikeObject<integer>|integer (optional)\n Array shape. Overrides the input array's inferred shape.\n\n options.dtype: string (optional)\n Array data type. Overrides the input array's inferred data type.\n\n options.order: string (optional)\n Array order (either 'row-major' (C-style) or 'column-major' (Fortran-\n style)). Overrides the input array's inferred order.\n\n options.mode: string (optional)\n Specifies how to handle indices which exceed array dimensions. If equal\n to 'throw', an ndarray instance throws an error when an index exceeds\n array dimensions. If equal to 'wrap', an ndarray instance wraps around\n indices exceeding array dimensions using modulo arithmetic. If equal to\n 'clamp', an ndarray instance sets an index exceeding array dimensions to\n either `0` (minimum index) or the maximum index. Default: 'throw'.\n\n options.submode: Array<string> (optional)\n Specifies how to handle subscripts which exceed array dimensions. If a\n mode for a corresponding dimension is equal to 'throw', an ndarray\n instance throws an error when a subscript exceeds array dimensions. If\n equal to 'wrap', an ndarray instance wraps around subscripts exceeding\n array dimensions using modulo arithmetic. If equal to 'clamp', an\n ndarray instance sets a subscript exceeding array dimensions to either\n `0` (minimum index) or the maximum index. If the number of modes is\n fewer than the number of dimensions, the function recycles modes using\n modulo arithmetic. Default: [ options.mode ].\n\n Returns\n -------\n out: ndarray\n Output array.\n\n Examples\n --------\n > var x = base.ndzeros( 'float64', [ 2, 2 ], 'row-major' )\n <ndarray>\n > var sh = x.shape\n [ 2, 2 ]\n > var dt = x.dtype\n 'float64'\n > var y = ndemptyLike( x )\n <ndarray>\n > sh = y.shape\n [ 2, 2 ]\n > dt = y.dtype\n 'float64'\n\n See Also\n --------\n ndempty, ndzerosLike\n"
3682+
ndims,"\nndims( x )\n Returns the number of ndarray dimensions.\n\n Parameters\n ----------\n x: ndarray\n Input ndarray.\n\n Returns\n -------\n n: integer\n Number of dimensions.\n\n Examples\n --------\n > var n = ndims( ndzeros( [ 3, 3, 3 ] ) )\n 3\n\n See Also\n --------\n array, ndarray, numel\n"
36823683
nditerColumns,"\nnditerColumns( x[, options] )\n Returns an iterator which iterates over each column in a matrix (or stack of\n matrices).\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n If an environment supports Symbol.iterator, the function explicitly does not\n invoke an ndarray's `@@iterator` method, regardless of whether this method\n is defined.\n\n Parameters\n ----------\n x: ndarray\n Input ndarray for which to create the iterator.\n\n options: Object (optional)\n Options.\n\n options.readonly: boolean (optional)\n Boolean indicating whether returned ndarray views should be read-only.\n If the input ndarray is read-only, setting this option to `false` raises\n an exception. Default: true.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n Examples\n --------\n > var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );\n > var it = nditerColumns( x );\n > var v = it.next().value;\n > ndarray2array( v )\n [ 1, 3 ]\n > v = it.next().value;\n > ndarray2array( v )\n [ 2, 4 ]\n\n See Also\n --------\n nditerRows, ndslice\n"
36833684
nditerEntries,"\nnditerEntries( x[, options] )\n Returns an iterator which returns [index, value] pairs for each element in a\n provided ndarray.\n\n Each returned index is a Cartesian index (i.e., an array of subscripts/\n dimension indices).\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n If an environment supports Symbol.iterator, the function explicitly does not\n invoke an ndarray's `@@iterator` method, regardless of whether this method\n is defined.\n\n Parameters\n ----------\n x: ndarray\n Input array.\n\n options: Object (optional)\n Options.\n\n options.order: string (optional)\n Index iteration order. By default, the returned iterator returns values\n according to the layout order of the provided array. Accordingly, for\n row-major input arrays, the last dimension indices increment fastest.\n For column-major input arrays, the first dimension indices increment\n fastest. To override the inferred order and ensure that indices\n increment in a specific manor, regardless of the input array's layout\n order, explicitly set the iteration order. Note, however, that iterating\n according to an order which does not match that of the input array may,\n in some circumstances, result in performance degradation due to cache\n misses. Must be either 'row-major' or 'column-major'.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n Examples\n --------\n > var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );\n > var it = nditerEntries( x );\n > var v = it.next().value\n [ [ 0, 0 ], 1 ]\n > v = it.next().value\n [ [ 0, 1 ], 2 ]\n\n See Also\n --------\n ndarray, nditerIndices, nditerValues\n"
36843685
nditerIndices,"\nnditerIndices( shape[, options] )\n Returns an iterator which returns indices for use indexing into an ndarray\n having a specified shape.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n shape: Array<integer>\n Input shape.\n\n options: Object (optional)\n Options.\n\n options.order: string (optional)\n Index iteration order. By default, the returned iterator iterates over\n the last dimensions first, thus corresponding to iteration over\n contiguous data stored in row-major order. Must be either 'row-major'\n or 'column-major'.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n Examples\n --------\n > var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );\n > var it = nditerIndices( x.shape );\n > var v = it.next().value\n [ 0, 0 ]\n > v = it.next().value\n [ 0, 1 ]\n\n See Also\n --------\n ndarray, nditerEntries, nditerValues\n"

lib/node_modules/@stdlib/repl/help/data/data.json

+1-1
Large diffs are not rendered by default.

lib/node_modules/@stdlib/repl/info/data/data.csv

+1
Original file line numberDiff line numberDiff line change
@@ -3712,6 +3712,7 @@ now,"\nnow()\n Returns the time in seconds since the epoch.\n"
37123712
NUM_CPUS,"\nNUM_CPUS\n Number of CPUs.\n"
37133713
num2words,"\nnum2words( value:integer[, options:Object] )\n Converts a number to a word representation.\n"
37143714
Number,"\nNumber( value:number )\n Returns a Number object.\n"
3715+
numel,"\nnumel( x:ndarray )\n Returns the number of elements in an ndarray.\n"
37153716
numGraphemeClusters,"\nnumGraphemeClusters( str:string )\n Returns the number of grapheme clusters in a string.\n"
37163717
Object,"\nObject( value:any )\n Returns an object.\n"
37173718
Object.assign,"\nObject.assign( target:Object, ...sources:Object )\n Assigns enumerable and own properties from source objects to a target\n object.\n"

lib/node_modules/@stdlib/repl/info/data/data.json

+1-1
Large diffs are not rendered by default.

lib/node_modules/@stdlib/repl/signature/data/data.csv

+1
Original file line numberDiff line numberDiff line change
@@ -3749,6 +3749,7 @@ now,"now()"
37493749
NUM_CPUS,"NUM_CPUS"
37503750
num2words,"num2words( value[, options] )"
37513751
Number,"Number( value )"
3752+
numel,"numel( x )"
37523753
numGraphemeClusters,"numGraphemeClusters( str )"
37533754
Object,"Object( value )"
37543755
Object.assign,"Object.assign( target, ...sources )"

lib/node_modules/@stdlib/repl/signature/data/data.json

+1-1
Large diffs are not rendered by default.

lib/node_modules/@stdlib/repl/typed-signature/data/data.csv

+1
Original file line numberDiff line numberDiff line change
@@ -3749,6 +3749,7 @@ now,"now()"
37493749
NUM_CPUS,"NUM_CPUS"
37503750
num2words,"num2words( value:integer[, options:Object] )"
37513751
Number,"Number( value:number )"
3752+
numel,"numel( x:ndarray )"
37523753
numGraphemeClusters,"numGraphemeClusters( str:string )"
37533754
Object,"Object( value:any )"
37543755
Object.assign,"Object.assign( target:Object, ...sources:Object )"

lib/node_modules/@stdlib/repl/typed-signature/data/data.json

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)