From bb92007798050901abe4e84bb88b65ef072d3e0c Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Sat, 9 May 2026 21:54:00 -0700 Subject: [PATCH] docs: improve doctests for complex number typed arrays in `ndarray/from-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 --- --- .../ndarray/from-scalar/docs/types/index.d.ts | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/from-scalar/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/from-scalar/docs/types/index.d.ts index e5ef90795bae..17a8cc1abefc 100644 --- a/lib/node_modules/@stdlib/ndarray/from-scalar/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/from-scalar/docs/types/index.d.ts @@ -229,8 +229,6 @@ declare function scalar2ndarray( value: number, options: Float32Options ): float * * @example * var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var real = require( '@stdlib/complex/float64/real' ); -* var imag = require( '@stdlib/complex/float64/imag' ); * * var v = new Complex128( 1.0, 2.0 ); * @@ -245,14 +243,8 @@ declare function scalar2ndarray( value: number, options: Float32Options ): float * var dt = x.dtype; * // returns 'complex128' * -* var v = x.get(); -* // returns -* -* var re = real( v ); -* // returns 1.0 -* -* var im = imag( v ); -* // returns 2.0 +* var buf = x.data; +* // buf => [ 1.0, 2.0 ] */ declare function scalar2ndarray( value: number | ComplexLike, options: Complex128Options ): complex128ndarray; @@ -268,9 +260,7 @@ declare function scalar2ndarray( value: number | ComplexLike, options: Complex12 * @returns zero-dimensional ndarray * * @example -* var Complex64 = require( '@stdlib/complex/float64/ctor' ); -* var realf = require( '@stdlib/complex/float32/real' ); -* var imagf = require( '@stdlib/complex/float32/imag' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); * * var v = new Complex64( 1.0, 2.0 ); * @@ -285,14 +275,8 @@ declare function scalar2ndarray( value: number | ComplexLike, options: Complex12 * var dt = x.dtype; * // returns 'complex64' * -* var v = x.get(); -* // 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 scalar2ndarray( value: number | ComplexLike, options: Complex64Options ): complex64ndarray;