From a076d78faceb97306d079930f3315de8778c0fbb Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Sat, 9 May 2026 21:28:58 -0700 Subject: [PATCH] docs: improve doctests for complex number typed arrays in `ndarray/base/map` --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/ndarray/base/map/lib/0d_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/10d_accessors.js | 9 +-------- .../ndarray/base/map/lib/10d_blocked_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/1d_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/2d_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/2d_blocked_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/3d_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/3d_blocked_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/4d_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/4d_blocked_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/5d_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/5d_blocked_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/6d_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/6d_blocked_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/7d_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/7d_blocked_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/8d_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/8d_blocked_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/9d_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/9d_blocked_accessors.js | 9 +-------- .../@stdlib/ndarray/base/map/lib/nd_accessors.js | 9 +-------- 21 files changed, 21 insertions(+), 168 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/0d_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/0d_accessors.js index 18083195849d..f540223c530c 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/0d_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/0d_accessors.js @@ -102,14 +102,7 @@ * * // Apply function: * map0d( x, y, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 30.0 -* -* var im = imagf( v ); -* // returns 40.0 +* // ybuf => [ 30.0, 40.0, 0.0, 0.0 ] */ function map0d( x, y, fcn, thisArg ) { y.accessors[ 1 ]( y.data, y.offset, fcn.call( thisArg, x.accessors[ 0 ]( x.data, x.offset ), [], x.ref ) ); // eslint-disable-line max-len diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/10d_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/10d_accessors.js index 687f156dd384..c44fbce743d2 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/10d_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/10d_accessors.js @@ -112,14 +112,7 @@ var take = require( '@stdlib/array/base/take-indexed' ); * * // Apply function: * map10d( x, y, true, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function map10d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements var xbuf; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/10d_blocked_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/10d_blocked_accessors.js index 0dc449f76b49..6bc57fa14875 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/10d_blocked_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/10d_blocked_accessors.js @@ -112,14 +112,7 @@ var reverse = require( '@stdlib/array/base/reverse' ); * * // Apply function: * blockedmap10d( x, y, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function blockedmap10d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function var bsize; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/1d_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/1d_accessors.js index dfa60af6faf4..6feb6156a62e 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/1d_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/1d_accessors.js @@ -102,14 +102,7 @@ * * // Apply function: * map1d( x, y, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function map1d( x, y, fcn, thisArg ) { var xbuf; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/2d_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/2d_accessors.js index 0f6abfc3f042..ea1f1aad682b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/2d_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/2d_accessors.js @@ -110,14 +110,7 @@ var take = require( '@stdlib/array/base/take-indexed' ); * * // Apply function: * map2d( x, y, true, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function map2d( x, y, isRowMajor, fcn, thisArg ) { var xbuf; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/2d_blocked_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/2d_blocked_accessors.js index 7baf3614971a..cb04c0a0fc46 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/2d_blocked_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/2d_blocked_accessors.js @@ -110,14 +110,7 @@ var reverse = require( '@stdlib/array/base/reverse' ); * * // Apply function: * blockedmap2d( x, y, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function blockedmap2d( x, y, fcn, thisArg ) { var bsize; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/3d_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/3d_accessors.js index 0b4469feae55..7ab788abb086 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/3d_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/3d_accessors.js @@ -110,14 +110,7 @@ var take = require( '@stdlib/array/base/take-indexed' ); * * // Apply function: * map3d( x, y, true, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function map3d( x, y, isRowMajor, fcn, thisArg ) { var xbuf; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/3d_blocked_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/3d_blocked_accessors.js index c5a12763f6fd..74a164358f10 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/3d_blocked_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/3d_blocked_accessors.js @@ -112,14 +112,7 @@ var reverse = require( '@stdlib/array/base/reverse' ); * * // Apply function: * blockedmap3d( x, y, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function blockedmap3d( x, y, fcn, thisArg ) { var bsize; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/4d_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/4d_accessors.js index 2996b8352ec4..08d2a2592c96 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/4d_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/4d_accessors.js @@ -110,14 +110,7 @@ var take = require( '@stdlib/array/base/take-indexed' ); * * // Apply function: * map4d( x, y, true, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function map4d( x, y, isRowMajor, fcn, thisArg ) { var xbuf; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/4d_blocked_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/4d_blocked_accessors.js index b66c6f2dc6ab..dccc6ef572f4 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/4d_blocked_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/4d_blocked_accessors.js @@ -112,14 +112,7 @@ var reverse = require( '@stdlib/array/base/reverse' ); * * // Apply function: * blockedmap4d( x, y, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function blockedmap4d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements var bsize; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/5d_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/5d_accessors.js index ad62317a0722..d3f7af18581c 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/5d_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/5d_accessors.js @@ -110,14 +110,7 @@ var take = require( '@stdlib/array/base/take-indexed' ); * * // Apply function: * map5d( x, y, true, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function map5d( x, y, isRowMajor, fcn, thisArg ) { var xbuf; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/5d_blocked_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/5d_blocked_accessors.js index 91c28a131831..9b726a240315 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/5d_blocked_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/5d_blocked_accessors.js @@ -112,14 +112,7 @@ var reverse = require( '@stdlib/array/base/reverse' ); * * // Apply function: * blockedmap5d( x, y, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function blockedmap5d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements var bsize; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/6d_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/6d_accessors.js index 4446ce066ad1..f89ee693ba81 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/6d_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/6d_accessors.js @@ -112,14 +112,7 @@ var take = require( '@stdlib/array/base/take-indexed' ); * * // Apply function: * map6d( x, y, true, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function map6d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements var xbuf; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/6d_blocked_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/6d_blocked_accessors.js index d8bc2e4cc3fe..eaee43839ce3 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/6d_blocked_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/6d_blocked_accessors.js @@ -112,14 +112,7 @@ var reverse = require( '@stdlib/array/base/reverse' ); * * // Apply function: * blockedmap6d( x, y, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function blockedmap6d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements var bsize; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/7d_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/7d_accessors.js index 6eb9d619d7b8..dc688dc5f65a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/7d_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/7d_accessors.js @@ -112,14 +112,7 @@ var take = require( '@stdlib/array/base/take-indexed' ); * * // Apply function: * map7d( x, y, true, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function map7d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements var xbuf; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/7d_blocked_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/7d_blocked_accessors.js index cecd5de7ea4b..120cb04b173e 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/7d_blocked_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/7d_blocked_accessors.js @@ -112,14 +112,7 @@ var reverse = require( '@stdlib/array/base/reverse' ); * * // Apply function: * blockedmap7d( x, y, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function blockedmap7d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements var bsize; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/8d_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/8d_accessors.js index 92e955c400f4..1b4ac387e030 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/8d_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/8d_accessors.js @@ -112,14 +112,7 @@ var take = require( '@stdlib/array/base/take-indexed' ); * * // Apply function: * map8d( x, y, true, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function map8d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements var xbuf; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/8d_blocked_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/8d_blocked_accessors.js index 2a78ab3a44d6..051a9049213f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/8d_blocked_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/8d_blocked_accessors.js @@ -112,14 +112,7 @@ var reverse = require( '@stdlib/array/base/reverse' ); * * // Apply function: * blockedmap8d( x, y, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function blockedmap8d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function var bsize; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/9d_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/9d_accessors.js index 14133dd5831e..6a00005ef73f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/9d_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/9d_accessors.js @@ -112,14 +112,7 @@ var take = require( '@stdlib/array/base/take-indexed' ); * * // Apply function: * map9d( x, y, true, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function map9d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements var xbuf; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/9d_blocked_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/9d_blocked_accessors.js index 8f85bbc1f577..c8a889d398cd 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/9d_blocked_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/9d_blocked_accessors.js @@ -112,14 +112,7 @@ var reverse = require( '@stdlib/array/base/reverse' ); * * // Apply function: * blockedmap9d( x, y, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function blockedmap9d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements, max-lines-per-function var bsize; diff --git a/lib/node_modules/@stdlib/ndarray/base/map/lib/nd_accessors.js b/lib/node_modules/@stdlib/ndarray/base/map/lib/nd_accessors.js index 18e7e43f480d..f65fa4e6d691 100644 --- a/lib/node_modules/@stdlib/ndarray/base/map/lib/nd_accessors.js +++ b/lib/node_modules/@stdlib/ndarray/base/map/lib/nd_accessors.js @@ -114,14 +114,7 @@ var MODE = 'throw'; * * // Apply function: * mapnd( x, y, scale, {} ); -* -* var v = y.data.get( 0 ); -* -* var re = realf( v ); -* // returns 10.0 -* -* var im = imagf( v ); -* // returns 20.0 +* // ybuf => [ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0 ] */ function mapnd( x, y, fcn, thisArg ) { var xbuf;