Skip to content

Commit ac64f6d

Browse files
committed
fix: update test, benchmark and examples to match dfill implementation
--- 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: 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: na - task: lint_license_headers status: passed ---
1 parent e2d69e0 commit ac64f6d

3 files changed

Lines changed: 51 additions & 51 deletions

File tree

lib/node_modules/@stdlib/blas/ext/base/ndarray/dfill/benchmark/benchmark.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
// MODULES //
2222

23-
var bench = require('@stdlib/bench');
24-
var uniform = require('@stdlib/random/array/uniform');
25-
var isnan = require('@stdlib/math/base/assert/is-nan');
26-
var pow = require('@stdlib/math/base/special/pow');
27-
var ndarray = require('@stdlib/ndarray/base/ctor');
28-
var getData = require('@stdlib/ndarray/base/data-buffer');
29-
var pkg = require('./../package.json').name;
30-
var dfill = require('./../lib');
23+
var bench = require( '@stdlib/bench' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
25+
var isnan = require( '@stdlib/math/base/assert/is-nan' );
26+
var pow = require( '@stdlib/math/base/special/pow' );
27+
var ndarray = require( '@stdlib/ndarray/base/ctor' );
28+
var getData = require( '@stdlib/ndarray/base/data-buffer' );
29+
var pkg = require( './../package.json' ).name;
30+
var dfill = require( './../lib' );
3131

3232

3333
// VARIABLES //

lib/node_modules/@stdlib/blas/ext/base/ndarray/dfill/examples/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ var ndarray = require( '@stdlib/ndarray/base/ctor' );
2323
var ndarray2array = require( '@stdlib/ndarray/to-array' );
2424
var dfill = require( './../lib' );
2525

26-
var xbuf = discreteUniform(10, -50, 50, {
26+
var xbuf = discreteUniform( 10, -50, 50, {
2727
'dtype': 'float64'
2828
});
29-
var x = new ndarray('float64', xbuf, [xbuf.length], [1], 0, 'row-major');
30-
console.log(ndarray2array(x));
29+
var x = new ndarray( 'float64', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
30+
console.log( ndarray2array( x ) );
3131

32-
dfill(5.0, [x]);
33-
console.log(ndarray2array(x));
32+
dfill( 5.0, [ x ] );
33+
console.log( ndarray2array( x ) );

lib/node_modules/@stdlib/blas/ext/base/ndarray/dfill/test/test.js

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020

2121
// MODULES //
2222

23-
var tape = require('tape');
24-
var Float64Array = require('@stdlib/array/float64');
25-
var ndarray = require('@stdlib/ndarray/base/ctor');
26-
var getData = require('@stdlib/ndarray/base/data-buffer');
27-
var dfill = require('./../lib');
23+
var tape = require( 'tape' );
24+
var Float64Array = require( '@stdlib/array/float64' );
25+
var ndarray = require( '@stdlib/ndarray/base/ctor' );
26+
var getData = require( '@stdlib/ndarray/base/data-buffer' );
27+
var dfill = require( './../lib' );
2828

2929

3030
// FUNCTIONS //
@@ -39,62 +39,62 @@ var dfill = require('./../lib');
3939
* @param {NonNegativeInteger} offset - index offset
4040
* @returns {ndarray} one-dimensional ndarray
4141
*/
42-
function vector(buffer, length, stride, offset) {
43-
return new ndarray('float64', buffer, [length], [stride], offset, 'row-major');
42+
function vector( buffer, length, stride, offset ) {
43+
return new ndarray( 'float64', buffer, [ length ], [ stride ], offset, 'row-major' );
4444
}
4545

4646

4747
// TESTS //
4848

49-
tape('main export is a function', function test(t) {
50-
t.ok(true, __filename);
51-
t.strictEqual(typeof dfill, 'function', 'main export is a function');
49+
tape( 'main export is a function', function test( t ) {
50+
t.ok( true, __filename );
51+
t.strictEqual( typeof dfill, 'function', 'main export is a function' );
5252
t.end();
5353
});
5454

55-
tape('the function has an arity of 2', function test(t) {
56-
t.strictEqual(dfill.length, 2, 'has expected arity');
55+
tape( 'the function has an arity of 2', function test( t ) {
56+
t.strictEqual( dfill.length, 2, 'has expected arity' );
5757
t.end();
5858
});
5959

60-
tape('the function fills a one-dimensional ndarray with a specified scalar constant', function test(t) {
60+
tape( 'the function fills a one-dimensional ndarray with a specified scalar constant', function test( t ) {
6161
var expected;
6262
var x;
6363

64-
x = new Float64Array([1.0, -2.0, 3.0, -4.0, 5.0, -6.0]);
65-
expected = new Float64Array([5.0, 5.0, 5.0, 5.0, 5.0, 5.0]);
64+
x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
65+
expected = new Float64Array( [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] );
6666

67-
dfill(5.0, [vector(x, 6, 1, 0)]);
68-
t.deepEqual(x, expected, 'returns expected value');
67+
dfill( 5.0, [ vector( x, 6, 1, 0 ) ] );
68+
t.deepEqual( x, expected, 'returns expected value' );
6969

7070
t.end();
7171
});
7272

73-
tape('the function returns the input ndarray', function test(t) {
73+
tape( 'the function returns the input ndarray', function test( t ) {
7474
var x;
7575
var y;
7676

77-
x = new Float64Array([1.0, -2.0, 3.0, -4.0, 5.0, -6.0]);
78-
y = dfill(5.0, [vector(x, 6, 1, 0)]);
77+
x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
78+
y = dfill( 5.0, [ vector( x, 6, 1, 0 ) ] );
7979

80-
t.strictEqual(getData(y), x, 'returns expected value');
80+
t.strictEqual( getData( y ), x, 'returns expected value' );
8181
t.end();
8282
});
8383

84-
tape('if provided an empty ndarray, the function returns the input ndarray unchanged', function test(t) {
84+
tape( 'if provided an empty ndarray, the function returns the input ndarray unchanged', function test( t ) {
8585
var expected;
8686
var x;
8787

88-
x = new Float64Array([]);
89-
expected = new Float64Array([]);
88+
x = new Float64Array( [] );
89+
expected = new Float64Array( [] );
9090

91-
dfill(5.0, [vector(x, 0, 1, 0)]);
92-
t.deepEqual(x, expected, 'returns expected value');
91+
dfill( 5.0, [ vector( x, 0, 1, 0 ) ] );
92+
t.deepEqual( x, expected, 'returns expected value' );
9393

9494
t.end();
9595
});
9696

97-
tape('the function supports one-dimensional ndarrays having non-unit strides', function test(t) {
97+
tape( 'the function supports one-dimensional ndarrays having non-unit strides', function test( t ) {
9898
var expected;
9999
var x;
100100

@@ -108,15 +108,15 @@ tape('the function supports one-dimensional ndarrays having non-unit strides', f
108108
4.0, // 3
109109
2.0
110110
]);
111-
expected = new Float64Array([5.0, 2.0, 5.0, -7.0, 5.0, 3.0, 5.0, 2.0]);
111+
expected = new Float64Array( [ 5.0, 2.0, 5.0, -7.0, 5.0, 3.0, 5.0, 2.0 ] );
112112

113-
dfill(5.0, [vector(x, 4, 2, 0)]);
113+
dfill( 5.0, [ vector( x, 4, 2, 0 ) ] );
114114

115-
t.deepEqual(x, expected, 'returns expected value');
115+
t.deepEqual( x, expected, 'returns expected value' );
116116
t.end();
117117
});
118118

119-
tape('the function supports one-dimensional ndarrays having negative strides', function test(t) {
119+
tape( 'the function supports one-dimensional ndarrays having negative strides', function test( t ) {
120120
var expected;
121121
var x;
122122

@@ -130,15 +130,15 @@ tape('the function supports one-dimensional ndarrays having negative strides', f
130130
4.0, // 0
131131
2.0
132132
]);
133-
expected = new Float64Array([5.0, 2.0, 5.0, -7.0, 5.0, 3.0, 5.0, 2.0]);
133+
expected = new Float64Array( [ 5.0, 2.0, 5.0, -7.0, 5.0, 3.0, 5.0, 2.0 ] );
134134

135-
dfill(5.0, [vector(x, 4, -2, 6)]);
135+
dfill( 5.0, [ vector( x, 4, -2, 6 ) ] );
136136

137-
t.deepEqual(x, expected, 'returns expected value');
137+
t.deepEqual( x, expected, 'returns expected value' );
138138
t.end();
139139
});
140140

141-
tape('the function supports one-dimensional ndarrays having non-zero offsets', function test(t) {
141+
tape( 'the function supports one-dimensional ndarrays having non-zero offsets', function test( t ) {
142142
var expected;
143143
var x;
144144

@@ -152,10 +152,10 @@ tape('the function supports one-dimensional ndarrays having non-zero offsets', f
152152
3.0,
153153
4.0 // 3
154154
]);
155-
expected = new Float64Array([2.0, 5.0, 2.0, 5.0, -2.0, 5.0, 3.0, 5.0]);
155+
expected = new Float64Array( [ 2.0, 5.0, 2.0, 5.0, -2.0, 5.0, 3.0, 5.0 ] );
156156

157-
dfill(5.0, [vector(x, 4, 2, 1)]);
158-
t.deepEqual(x, expected, 'returns expected value');
157+
dfill( 5.0, [ vector( x, 4, 2, 1 ) ] );
158+
t.deepEqual( x, expected, 'returns expected value' );
159159

160160
t.end();
161161
});

0 commit comments

Comments
 (0)