From e6623ef9394dee5f796ed76e231fd0ac67d71369 Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Sat, 9 May 2026 21:23:37 -0700 Subject: [PATCH 1/3] docs: improve doctests for complex number typed arrays in `ndarray/base/broadcast-scalar` --- 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: na - 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: passed - task: lint_license_headers status: passed --- --- .../base/broadcast-scalar/docs/types/index.d.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/docs/types/index.d.ts index 0bdd46cba7ac..ac278ea0483b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/docs/types/index.d.ts @@ -106,8 +106,8 @@ declare function broadcastScalar( value: number, dtype: 'float32', shape: Shape, * var dt = String( getDType( x ) ); * // returns 'complex128' * -* var v = x.get( 0, 1 ); -* // returns [ 1.0, 2.0 ] +* var buf = x.data; +* // buf => [ 1.0, 2.0 ] */ declare function broadcastScalar( value: number | ComplexLike, dtype: 'complex128', shape: Shape, order: Order ): complex128ndarray; @@ -128,8 +128,6 @@ declare function broadcastScalar( value: number | ComplexLike, dtype: 'complex12 * var getShape = require( '@stdlib/ndarray/shape' ); * var getDType = require( '@stdlib/ndarray/dtype' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var realf = require( '@stdlib/complex/float32/real' ); -* var imagf = require( '@stdlib/complex/float32/imag' ); * * var v = new Complex64( 1.0, 2.0 ); * @@ -142,14 +140,8 @@ declare function broadcastScalar( value: number | ComplexLike, dtype: 'complex12 * var dt = String( getDType( x ) ); * // returns 'complex64' * -* var v = x.get( 0, 1 ); -* // returns -* -* var re = realf( v ); -* // returns 1.0 -* -* var im = imagf( v ); -* // returns 2.0 +* var buf = x.data; +* // buf => [ 1.0, 2.0 ] */ declare function broadcastScalar( value: number | ComplexLike, dtype: 'complex64', shape: Shape, order: Order ): complex64ndarray; From d0cdd9620333cf5ae6337d2486762fe54e74fb78 Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 10 May 2026 04:28:42 -0700 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../ndarray/base/broadcast-scalar/docs/types/index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/docs/types/index.d.ts index ac278ea0483b..a16f3e63548b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/docs/types/index.d.ts @@ -93,6 +93,7 @@ declare function broadcastScalar( value: number, dtype: 'float32', shape: Shape, * @example * var getShape = require( '@stdlib/ndarray/shape' ); * var getDType = require( '@stdlib/ndarray/dtype' ); +* var getData = require( '@stdlib/ndarray/data-buffer' ); * var Complex128 = require( '@stdlib/complex/float64/ctor' ); * * var v = new Complex128( 1.0, 2.0 ); @@ -106,7 +107,7 @@ declare function broadcastScalar( value: number, dtype: 'float32', shape: Shape, * var dt = String( getDType( x ) ); * // returns 'complex128' * -* var buf = x.data; +* var buf = getData( x ); * // buf => [ 1.0, 2.0 ] */ declare function broadcastScalar( value: number | ComplexLike, dtype: 'complex128', shape: Shape, order: Order ): complex128ndarray; @@ -127,6 +128,7 @@ declare function broadcastScalar( value: number | ComplexLike, dtype: 'complex12 * @example * var getShape = require( '@stdlib/ndarray/shape' ); * var getDType = require( '@stdlib/ndarray/dtype' ); +* var getData = require( '@stdlib/ndarray/data-buffer' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * * var v = new Complex64( 1.0, 2.0 ); @@ -140,7 +142,7 @@ declare function broadcastScalar( value: number | ComplexLike, dtype: 'complex12 * var dt = String( getDType( x ) ); * // returns 'complex64' * -* var buf = x.data; +* var buf = getData( x ); * // buf => [ 1.0, 2.0 ] */ declare function broadcastScalar( value: number | ComplexLike, dtype: 'complex64', shape: Shape, order: Order ): complex64ndarray; From 5fc092d8a0d77883abbc37925761f61f62bf5897 Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 10 May 2026 04:30:03 -0700 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../ndarray/base/broadcast-scalar/docs/types/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/docs/types/index.d.ts index a16f3e63548b..d61a736c43a8 100644 --- a/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/docs/types/index.d.ts @@ -108,7 +108,7 @@ declare function broadcastScalar( value: number, dtype: 'float32', shape: Shape, * // returns 'complex128' * * var buf = getData( x ); -* // buf => [ 1.0, 2.0 ] +* // returns [ 1.0, 2.0 ] */ declare function broadcastScalar( value: number | ComplexLike, dtype: 'complex128', shape: Shape, order: Order ): complex128ndarray; @@ -143,7 +143,7 @@ declare function broadcastScalar( value: number | ComplexLike, dtype: 'complex12 * // returns 'complex64' * * var buf = getData( x ); -* // buf => [ 1.0, 2.0 ] +* // returns [ 1.0, 2.0 ] */ declare function broadcastScalar( value: number | ComplexLike, dtype: 'complex64', shape: Shape, order: Order ): complex64ndarray;