Skip to content

Commit d4d0940

Browse files
authored
docs: update REPL namespace documentation
PR-URL: #11148 Reviewed-by: Athan Reines <kgryte@gmail.com>
1 parent 569131f commit d4d0940

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4200,8 +4200,8 @@ ndarrayShape,"var out = ndarrayShape( ndzeros( [ 3, 3, 3 ] ) )\n"
42004200
ndarrayStride,"var out = ndarrayStride( ndzeros( [ 3, 3, 3 ] ), 0 )\n"
42014201
ndarrayStrides,"var out = ndarrayStrides( ndzeros( [ 3, 3, 3 ] ) )\n"
42024202
ndat,"var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );\nndat( x, 0, 1 )\nndat( x, 1, 0 )\n"
4203-
ndempty,"var arr = ndempty( [ 2, 2 ] )\nvar sh = arr.shape\nvar dt = arr.dtype\n"
4204-
ndemptyLike,"var x = base.ndzeros( 'float64', [ 2, 2 ], 'row-major' )\nvar sh = ndarrayShape( x )\nvar dt = ndarrayDataType( x ).toString()\nvar y = ndemptyLike( x )\nsh = ndarrayShape( y )\ndt = ndarrayDataType( y ).toString()\n"
4203+
ndempty,"var arr = ndempty( [ 2, 2 ] )\n"
4204+
ndemptyLike,"var x = ndzeros( [ 2, 2 ] )\nvar y = ndemptyLike( x )\n"
42054205
ndfill,"var opts = { 'dtype': 'float64' };\nvar x = ndzeros( [ 2, 2 ], opts );\nx.get( 0, 0 )\nndfill( x, 10.0 );\nx.get( 0, 0 )\n"
42064206
ndfillBy,"var opts = { 'dtype': 'float64' };\nvar x = ndzeros( [ 2, 2 ], opts );\nx.get( 0, 0 )\nfunction fcn() { return 10.0; };\nndfillBy( x, fcn );\nx.get( 0, 0 )\nx.get( 0, 1 )\nx.get( 1, 0 )\nx.get( 1, 1 )\n"
42074207
ndfilter,"var x = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] );\nfunction f( v ) { return v > 2.0; };\nvar y = ndfilter( x, f )\n"

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

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4201,8 +4201,8 @@ ndarrayShape,"\nndarrayShape( x )\n Returns the shape of a provided ndarray.\
42014201
ndarrayStride,"\nndarrayStride( x, dim )\n Returns the stride along a specified dimension for a provided ndarray.\n\n A \"stride\" is the linear distance (i.e., number of elements) between\n adjacent elements along a specified dimension.\n\n Parameters\n ----------\n x: ndarray\n Input ndarray.\n\n dim: integer\n Dimension index. If less than zero, the index is resolved relative to\n the last dimension, with the last dimension corresponding to the value\n `-1`.\n\n Returns\n -------\n out: integer\n Stride.\n\n Examples\n --------\n > var out = ndarrayStride( ndzeros( [ 3, 3, 3 ] ), 0 )\n 9\n\n See Also\n --------\n array, ndarray, ndarrayOffset, ndarrayOrder, ndarrayShape, ndarrayStrides\n"
42024202
ndarrayStrides,"\nndarrayStrides( x )\n Returns the strides of a provided ndarray.\n\n Parameters\n ----------\n x: ndarray\n Input ndarray.\n\n Returns\n -------\n out: Array<integer>\n Strides.\n\n Examples\n --------\n > var out = ndarrayStrides( ndzeros( [ 3, 3, 3 ] ) )\n [ 9, 3, 1 ]\n\n See Also\n --------\n array, ndarray, ndarrayOffset, ndarrayOrder, ndarrayShape\n"
42034203
ndat,"\nndat( x[, ...indices] )\n Returns an ndarray element.\n\n Negative indices are resolved relative to the last element along the\n respective dimension, with the last element corresponding to `-1`.\n\n If provided out-of-bounds indices, the function always returns `undefined`.\n\n Parameters\n ----------\n x: ndarray\n Input ndarray.\n\n indices: ...integer (optional)\n Index arguments. The number of index arguments must equal the number of\n dimensions.\n\n Returns\n -------\n out: any\n Element value.\n\n Examples\n --------\n > var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );\n > ndat( x, 0, 1 )\n 2\n > ndat( x, 1, 0 )\n 3\n\n See Also\n --------\n array, ndslice\n"
4204-
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 'normalize', an ndarray instance\n normalizes negative indices and 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\n to 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 'normalize', an ndarray instance normalizes negative\n subscripts and throws an error when a subscript exceeds array\n dimensions. If equal to 'wrap', an ndarray instance wraps around\n subscripts exceeding array dimensions using modulo arithmetic. If equal\n to 'clamp', an ndarray instance sets a subscript exceeding array\n dimensions to either `0` (minimum index) or the maximum index. If the\n number of modes is fewer than the number of dimensions, the function\n recycles modes using 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"
4205-
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 'normalize', an ndarray instance\n normalizes negative indices and 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\n to 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 'normalize', an ndarray instance normalizes negative\n subscripts and throws an error when a subscript exceeds array\n dimensions. If equal to 'wrap', an ndarray instance wraps around\n subscripts exceeding array dimensions using modulo arithmetic. If equal\n to 'clamp', an ndarray instance sets a subscript exceeding array\n dimensions to either `0` (minimum index) or the maximum index. If the\n number of modes is fewer than the number of dimensions, the function\n recycles modes using 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 = ndarrayShape( x )\n [ 2, 2 ]\n > var dt = ndarrayDataType( x ).toString()\n 'float64'\n > var y = ndemptyLike( x )\n <ndarray>\n > sh = ndarrayShape( y )\n [ 2, 2 ]\n > dt = ndarrayDataType( y ).toString()\n 'float64'\n\n See Also\n --------\n ndempty, ndzerosLike\n"
4204+
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|DataType (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 'normalize', an ndarray instance\n normalizes negative indices and 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\n to 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 'normalize', an ndarray instance normalizes negative\n subscripts and throws an error when a subscript exceeds array\n dimensions. If equal to 'wrap', an ndarray instance wraps around\n subscripts exceeding array dimensions using modulo arithmetic. If equal\n to 'clamp', an ndarray instance sets a subscript exceeding array\n dimensions to either `0` (minimum index) or the maximum index. If the\n number of modes is fewer than the number of dimensions, the function\n recycles modes using 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\n See Also\n --------\n ndemptyLike, ndzeros\n"
4205+
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|DataType (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 'normalize', an ndarray instance\n normalizes negative indices and 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\n to 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 'normalize', an ndarray instance normalizes negative\n subscripts and throws an error when a subscript exceeds array\n dimensions. If equal to 'wrap', an ndarray instance wraps around\n subscripts exceeding array dimensions using modulo arithmetic. If equal\n to 'clamp', an ndarray instance sets a subscript exceeding array\n dimensions to either `0` (minimum index) or the maximum index. If the\n number of modes is fewer than the number of dimensions, the function\n recycles modes using modulo arithmetic. Default: [ options.mode ].\n\n Returns\n -------\n out: ndarray\n Output array.\n\n Examples\n --------\n > var x = ndzeros( [ 2, 2 ] )\n <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]\n > var y = ndemptyLike( x )\n <ndarray>\n\n See Also\n --------\n ndempty, ndzerosLike\n"
42064206
ndfill,"\nndfill( x, value )\n Fills an input ndarray with a specified value.\n\n If `value` is a number and `x` has a complex data type, the function fills\n an input ndarray with a complex number whose real component equals the\n provided scalar `value` and whose imaginary component is zero.\n\n The function *mutates* the input ndarray.\n\n Parameters\n ----------\n x: ndarrayLike\n Input ndarray.\n\n value: any\n Scalar value. Must be able to safely cast to the input ndarray data\n type. Scalar values having floating-point data types (both real and\n complex) are allowed to downcast to a lower precision data type of the\n same kind (e.g., a scalar double-precision floating-point number can be\n used to fill a 'float32' input ndarray).\n\n Returns\n -------\n out: ndarrayLike\n Input ndarray.\n\n Examples\n --------\n > var opts = { 'dtype': 'float64' };\n > var x = ndzeros( [ 2, 2 ], opts );\n > x.get( 0, 0 )\n 0.0\n > ndfill( x, 10.0 );\n > x.get( 0, 0 )\n 10.0\n\n See Also\n --------\n ndfillBy, ndmap, ndzeros\n"
42074207
ndfillBy,"\nndfillBy( x, fcn[, thisArg] )\n Fills an input ndarray according to a callback function.\n\n The function *mutates* the input ndarray.\n\n The function assumes that each element in the underlying input ndarray data\n buffer has one, and only one, corresponding element in input ndarray view\n (i.e., a provided ndarray is not a broadcasted ndarray view).\n\n The callback function is provided the following arguments:\n\n - value: current array element.\n - indices: current array element indices.\n - arr: the input ndarray.\n\n Parameters\n ----------\n x: ndarrayLike\n Input ndarray.\n\n fcn: Function\n Callback function.\n\n thisArg: any (optional)\n Callback function execution context.\n\n Returns\n -------\n out: ndarrayLike\n Input ndarray.\n\n Examples\n --------\n > var opts = { 'dtype': 'float64' };\n > var x = ndzeros( [ 2, 2 ], opts );\n > x.get( 0, 0 )\n 0.0\n > function fcn() { return 10.0; };\n > ndfillBy( x, fcn );\n > x.get( 0, 0 )\n 10.0\n > x.get( 0, 1 )\n 10.0\n > x.get( 1, 0 )\n 10.0\n > x.get( 1, 1 )\n 10.0\n\n See Also\n --------\n ndfill, ndmap, ndzeros\n"
42084208
ndfilter,"\nndfilter( x[, options], predicate[, thisArg] )\n Returns a shallow copy of an ndarray containing only those elements which\n pass a test implemented by a predicate function.\n\n The predicate function is provided the following arguments:\n\n - value: current array element.\n - indices: current array element indices.\n - arr: the input ndarray.\n\n Parameters\n ----------\n x: ndarray\n Input ndarray.\n\n options: Object (optional)\n Function options.\n\n options.dtype: string (optional)\n Output ndarray data type. Overrides using the input array's inferred\n data type.\n\n options.order: string (optional)\n Index iteration order. By default, the function iterates over elements\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 manner, 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 predicate: Function\n Predicate function.\n\n thisArg: any (optional)\n Predicate function execution context.\n\n Examples\n --------\n > var x = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] );\n > function f( v ) { return v > 2.0; };\n > var y = ndfilter( x, f )\n <ndarray>[ 3.0, 4.0 ]\n\n See Also\n --------\n ndfilterMap, ndmap, ndreject, ndslice"

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

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)