From 5de5ceece8315069c593394b6c64aec4b9118ed9 Mon Sep 17 00:00:00 2001 From: headlessNode Date: Sat, 25 Apr 2026 23:35:53 +0500 Subject: [PATCH 1/2] feat: add ndarray/ndarraylike2scalar --- 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: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - 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/ndarraylike2scalar/README.md | 121 ++++++++++++++++++ .../ndarraylike2scalar/benchmark/benchmark.js | 91 +++++++++++++ .../ndarray/ndarraylike2scalar/docs/repl.txt | 23 ++++ .../ndarraylike2scalar/docs/types/index.d.ts | 45 +++++++ .../ndarraylike2scalar/docs/types/test.ts | 49 +++++++ .../ndarraylike2scalar/examples/index.js | 35 +++++ .../ndarray/ndarraylike2scalar/lib/index.js | 44 +++++++ .../ndarray/ndarraylike2scalar/lib/main.js | 56 ++++++++ .../ndarray/ndarraylike2scalar/package.json | 67 ++++++++++ .../ndarray/ndarraylike2scalar/test/test.js | 119 +++++++++++++++++ 10 files changed, 650 insertions(+) create mode 100644 lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/README.md create mode 100644 lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/examples/index.js create mode 100644 lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/lib/index.js create mode 100644 lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/lib/main.js create mode 100644 lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/package.json create mode 100644 lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/test/test.js diff --git a/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/README.md b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/README.md new file mode 100644 index 000000000000..09f4b3811bf4 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/README.md @@ -0,0 +1,121 @@ + + +# ndarraylike2scalar + +> Convert an ndarray-like object to a scalar value. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var ndarraylike2scalar = require( '@stdlib/ndarray/ndarraylike2scalar' ); +``` + +#### ndarraylike2scalar( x ) + +Converts an ndarray-like object to a scalar value. + +```javascript +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + +var x = scalar2ndarray( 1.0 ); +// returns [ 1.0 ] + +var out = ndarraylike2scalar( x ); +// returns 1.0 +``` + +
+ + + + + +
+ +
+ + + + + +
+ +## Examples + + + +```javascript +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var compose = require( '@stdlib/utils/compose' ); +var naryFunction = require( '@stdlib/utils/nary-function' ); +var oneTo = require( '@stdlib/array/one-to' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var ndarraylike2scalar = require( '@stdlib/ndarray/ndarraylike2scalar' ); + +// Create a list of scalars: +var scalars = oneTo( 10 ); + +// Create a composite function which round-trips a scalar to an ndarray and back: +var f = compose( ndarraylike2scalar, naryFunction( scalar2ndarray, 1 ) ); + +// Apply the function to the list of scalars: +logEachMap( '%d => %d', scalars, f ); +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/benchmark/benchmark.js b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/benchmark/benchmark.js new file mode 100644 index 000000000000..a431b60822ec --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/benchmark/benchmark.js @@ -0,0 +1,91 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var ndarraylike2scalar = require( './../lib' ); + + +// MAIN // + +bench( format( '%s::dtype=float64', pkg ), function benchmark( b ) { + var values; + var out; + var i; + + values = [ + scalar2ndarray( 1.0 ), + scalar2ndarray( 2.0 ), + scalar2ndarray( 3.0 ), + scalar2ndarray( 4.0 ), + scalar2ndarray( 5.0 ) + ]; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + out = ndarraylike2scalar( values[ i%values.length ] ); + if ( typeof out !== 'number' ) { + b.fail( 'should return a number' ); + } + } + b.toc(); + if ( !isNumber( out ) ) { + b.fail( 'should return a number' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); + +bench( format( '%s::dtype=float32', pkg ), function benchmark( b ) { + var values; + var opts; + var out; + var i; + + opts = { + 'dtype': 'float32' + }; + values = [ + scalar2ndarray( 1.0, opts ), + scalar2ndarray( 2.0, opts ), + scalar2ndarray( 3.0, opts ), + scalar2ndarray( 4.0, opts ), + scalar2ndarray( 5.0, opts ) + ]; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + out = ndarraylike2scalar( values[ i%values.length ] ); + if ( typeof out !== 'number' ) { + b.fail( 'should return a number' ); + } + } + b.toc(); + if ( !isNumber( out ) ) { + b.fail( 'should return a number' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/docs/repl.txt new file mode 100644 index 000000000000..8373b5ada79f --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/docs/repl.txt @@ -0,0 +1,23 @@ + +{{alias}}( x ) + Converts an ndarray-like object to a scalar value. + + Parameters + ---------- + x: ndarrayLike + Input ndarray-like object. + + Returns + ------- + out: any + Scalar value. + + Examples + -------- + > var x = {{alias:@stdlib/ndarray/from-scalar}}( 1.0 ); + > var out = {{alias}}( x ) + 1.0 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/docs/types/index.d.ts new file mode 100644 index 000000000000..ef481c9a353d --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/docs/types/index.d.ts @@ -0,0 +1,45 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { typedndarray } from '@stdlib/types/ndarray'; + +/** +* Converts an ndarray-like object to a scalar value. +* +* @param x - input ndarray +* @returns scalar value +* +* @example +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* +* var x = scalar2ndarray( 1.0 ); +* // returns [ 1.0 ] +* +* var out = ndarraylike2scalar( x ); +* // returns 1.0 +*/ +declare function ndarraylike2scalar( x: typedndarray ): T; + + +// EXPORTS // + +export = ndarraylike2scalar; diff --git a/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/docs/types/test.ts b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/docs/types/test.ts new file mode 100644 index 000000000000..05d6555e8f27 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/docs/types/test.ts @@ -0,0 +1,49 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/// + +import scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +import ndarraylike2scalar = require( './index' ); + + +// TESTS // + +// The function returns a scalar value... +{ + ndarraylike2scalar( scalar2ndarray( 1.0 ) ); // $ExpectType number +} + +// The compiler throws an error if the function is not provided an ndarray... +{ + ndarraylike2scalar( '5' ); // $ExpectError + ndarraylike2scalar( 123 ); // $ExpectError + ndarraylike2scalar( true ); // $ExpectError + ndarraylike2scalar( false ); // $ExpectError + ndarraylike2scalar( null ); // $ExpectError + ndarraylike2scalar( undefined ); // $ExpectError + ndarraylike2scalar( [] ); // $ExpectError + ndarraylike2scalar( {} ); // $ExpectError + ndarraylike2scalar( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + ndarraylike2scalar(); // $ExpectError + ndarraylike2scalar( scalar2ndarray( 1.0 ), {} ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/examples/index.js b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/examples/index.js new file mode 100644 index 000000000000..612fcedc9c57 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/examples/index.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var compose = require( '@stdlib/utils/compose' ); +var naryFunction = require( '@stdlib/utils/nary-function' ); +var oneTo = require( '@stdlib/array/one-to' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var ndarraylike2scalar = require( './../lib' ); + +// Create a list of scalars: +var scalars = oneTo( 10 ); + +// Create a composite function which round-trips a scalar to an ndarray and back: +var f = compose( ndarraylike2scalar, naryFunction( scalar2ndarray, 1 ) ); + +// Apply the function to the list of scalars: +logEachMap( '%d => %d', scalars, f ); diff --git a/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/lib/index.js b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/lib/index.js new file mode 100644 index 000000000000..f5f0c704719f --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/lib/index.js @@ -0,0 +1,44 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Convert an ndarray-like object to a scalar value. +* +* @module @stdlib/ndarray/ndarraylike2scalar +* +* @example +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* var ndarraylike2scalar = require( '@stdlib/ndarray/ndarraylike2scalar' ); +* +* var x = scalar2ndarray( 1.0 ); +* // returns [ 1.0 ] +* +* var out = ndarraylike2scalar( x ); +* // returns 1.0 +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/lib/main.js b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/lib/main.js new file mode 100644 index 000000000000..0781aa271dcc --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/lib/main.js @@ -0,0 +1,56 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); +var base = require( '@stdlib/ndarray/base/ndarraylike2scalar' ); +var format = require( '@stdlib/string/format' ); + + +// MAIN // + +/** +* Converts an ndarray-like object to a scalar value. +* +* @param {ndarrayLike} x - input ndarray +* @throws {TypeError} must provide an ndarray +* @returns {*} scalar value +* +* @example +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* +* var x = scalar2ndarray( 1.0 ); +* // returns [ 1.0 ] +* +* var out = ndarraylike2scalar( x ); +* // returns 1.0 +*/ +function ndarraylike2scalar( x ) { + if ( !isndarrayLike( x ) ) { + throw new TypeError( format( 'invalid argument. Must provide an ndarray. Value: `%s`.', x ) ); + } + return base( x ); +} + + +// EXPORTS // + +module.exports = ndarraylike2scalar; diff --git a/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/package.json b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/package.json new file mode 100644 index 000000000000..6e59f75128b8 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/package.json @@ -0,0 +1,67 @@ +{ + "name": "@stdlib/ndarray/ndarraylike2scalar", + "version": "0.0.0", + "description": "Convert an ndarray-like object to a scalar value.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdtypes", + "types", + "ndarray", + "multidimensional", + "array", + "convert", + "scalar", + "unwrap", + "utilities", + "utility", + "utils", + "util" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/test/test.js b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/test/test.js new file mode 100644 index 000000000000..b46710735a63 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/test/test.js @@ -0,0 +1,119 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarraylike2scalar = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof ndarraylike2scalar, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function throws an error if not provided an ndarray', function test( t ) { + var values; + var i; + + values = [ + '5', + 5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ndarraylike2scalar( value ); + }; + } +}); + +tape( 'the function converts an ndarray-like object to a scalar (dtype=float64)', function test( t ) { + var x = scalar2ndarray( 1.0 ); + t.strictEqual( ndarraylike2scalar( x ), 1.0, 'returns expected value' ); + t.end(); +}); + +tape( 'the function converts an ndarray-like object to a scalar (dtype=float32)', function test( t ) { + var x = scalar2ndarray( 2.0, { + 'dtype': 'float32' + }); + t.strictEqual( ndarraylike2scalar( x ), 2.0, 'returns expected value' ); + t.end(); +}); + +tape( 'the function converts an ndarray-like object to a scalar (dtype=int32)', function test( t ) { + var x = scalar2ndarray( 3, { + 'dtype': 'int32' + }); + t.strictEqual( ndarraylike2scalar( x ), 3, 'returns expected value' ); + t.end(); +}); + +tape( 'the function converts an ndarray-like object to a scalar (dtype=generic)', function test( t ) { + var x = scalar2ndarray( 'beep', { + 'dtype': 'generic' + }); + t.strictEqual( ndarraylike2scalar( x ), 'beep', 'returns expected value' ); + t.end(); +}); + +tape( 'the function converts an ndarray-like object to a scalar (dtype=bool)', function test( t ) { + var x = scalar2ndarray( true, { + 'dtype': 'bool' + }); + t.strictEqual( ndarraylike2scalar( x ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function converts an ndarray-like object to a scalar (dtype=complex64)', function test( t ) { + var actual; + var v; + var x; + + v = new Complex64( 1.0, 2.0 ); + x = scalar2ndarray( v, { + 'dtype': 'complex64' + }); + + actual = ndarraylike2scalar( x ); + t.strictEqual( realf( actual ), 1.0, 'returns expected value' ); + t.strictEqual( imagf( actual ), 2.0, 'returns expected value' ); + t.end(); +}); From 8014531dbc4322eb045782c4cf2563f97c3b3195 Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 26 Apr 2026 04:56:17 -0700 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../@stdlib/ndarray/ndarraylike2scalar/benchmark/benchmark.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/benchmark/benchmark.js b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/benchmark/benchmark.js index a431b60822ec..b6679ff47237 100644 --- a/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/ndarray/ndarraylike2scalar/benchmark/benchmark.js @@ -30,7 +30,7 @@ var ndarraylike2scalar = require( './../lib' ); // MAIN // -bench( format( '%s::dtype=float64', pkg ), function benchmark( b ) { +bench( format( '%s:dtype=float64', pkg ), function benchmark( b ) { var values; var out; var i; @@ -58,7 +58,7 @@ bench( format( '%s::dtype=float64', pkg ), function benchmark( b ) { b.end(); }); -bench( format( '%s::dtype=float32', pkg ), function benchmark( b ) { +bench( format( '%s:dtype=float32', pkg ), function benchmark( b ) { var values; var opts; var out;