Skip to content

Commit 4d12403

Browse files
committed
chore: clean-up
--- 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: 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: 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 ---
1 parent 6a37f38 commit 4d12403

9 files changed

Lines changed: 48 additions & 31 deletions

File tree

lib/node_modules/@stdlib/ndarray/some/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ var x = array( [ [ [ 1.0, 0.0 ] ], [ [ 3.0, 4.0 ] ], [ [ 0.0, 6.0 ] ] ] );
5151
var out = some( x, 3 );
5252
// returns <ndarray>
5353

54-
console.log( out.get() );
55-
// => true
54+
var v= out.get();
55+
// returns true
5656
```
5757

5858
The function accepts the following arguments:

lib/node_modules/@stdlib/ndarray/some/benchmark/benchmark.1d.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function main() {
130130

131131
sh = [ len ];
132132
f = createBenchmark( len, sh, t1, ord, dims );
133-
bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',' )+']', f );
133+
bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',')+']', f );
134134
}
135135
}
136136
}

lib/node_modules/@stdlib/ndarray/some/benchmark/benchmark.2d.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,17 @@ function main() {
134134

135135
sh = [ len/2, 2 ];
136136
f = createBenchmark( len, sh, t1, ord, dims );
137-
bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',' )+']', f );
137+
bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',')+']', f );
138138

139139
sh = [ 2, len/2 ];
140140
f = createBenchmark( len, sh, t1, ord, dims );
141-
bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',' )+']', f );
141+
bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',')+']', f );
142142

143143
len = floor( sqrt( len ) );
144144
sh = [ len, len ];
145145
len *= len;
146146
f = createBenchmark( len, sh, t1, ord, dims );
147-
bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',' )+']', f );
147+
bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',')+']', f );
148148
}
149149
}
150150
}

lib/node_modules/@stdlib/ndarray/some/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ interface Some {
129129
* var v = out.get();
130130
* // returns true
131131
*/
132-
assign<T = unknown>( x: InputArray<T>, n: integerndarray | number, y: ndarray, options?: BaseOptions ): ndarray;
132+
assign<T extends ndarray>( x: InputArray<unknown>, n: integerndarray | number, y: T, options?: BaseOptions ): T;
133133
}
134134

135135
/**

lib/node_modules/@stdlib/ndarray/some/docs/types/test.ts

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,6 @@ import some = require( './index' );
4343
some( x, n, { 'dims': [ 0 ] } ); // $ExpectType boolndarray
4444
}
4545

46-
// The function has an `assign` method which returns an ndarray...
47-
{
48-
const x = zeros( [ 2, 2 ] );
49-
const n = zeros( [], {
50-
'dtype': 'int32'
51-
});
52-
const y = empty( [], { 'dtype': 'bool' } );
53-
54-
some.assign( x, 2, y ); // $ExpectType ndarray
55-
some.assign( x, 2, y, { 'dims': [ 0 ] } ); // $ExpectType ndarray
56-
57-
some.assign( x, n, y ); // $ExpectType ndarray
58-
some.assign( x, n, y, { 'dims': [ 0 ] } ); // $ExpectType ndarray
59-
}
60-
6146
// The compiler throws an error if the function is provided a first argument which is not an ndarray...
6247
{
6348
some( 5, 2 ); // $ExpectError
@@ -79,7 +64,7 @@ import some = require( './index' );
7964
some( ( x: number ): number => x, 2, {} ); // $ExpectError
8065
}
8166

82-
// The compiler throws an error if the function is provided a second argument which is not an integer ndarray or a number...
67+
// The compiler throws an error if the function is provided a second argument which is not an ndarray or a number...
8368
{
8469
const x = zeros( [ 2, 2 ] );
8570

@@ -200,27 +185,47 @@ import some = require( './index' );
200185
some.assign( undefined, 2, y ); // $ExpectError
201186
some.assign( {}, 2, y ); // $ExpectError
202187
some.assign( [ 1 ], 2, y ); // $ExpectError
203-
some.assign( ( x: number ): number => x, 2, y ); // $ExpectError
188+
189+
some.assign( 5, 2, y, {} ); // $ExpectError
190+
some.assign( true, 2, y, {} ); // $ExpectError
191+
some.assign( false, 2, y, {} ); // $ExpectError
192+
some.assign( null, 2, y, {} ); // $ExpectError
193+
some.assign( undefined, 2, y, {} ); // $ExpectError
194+
some.assign( {}, 2, y, {} ); // $ExpectError
195+
some.assign( [ 1 ], 2, y, {} ); // $ExpectError
196+
some.assign( ( x: number ): number => x, 2, y, {} ); // $ExpectError
197+
some.assign( ( x: number ): number => x, 2, y, {} ); // $ExpectError
204198
}
205199

206-
// The compiler throws an error if the `assign` method is provided a second argument which is not an integer ndarray or a number...
200+
// The compiler throws an error if the `assign` method is provided a second argument which is not an ndarray or a number...
207201
{
208202
const x = zeros( [ 2, 2 ] );
209203
const y = empty( [] );
210204

205+
some.assign( x, '5', y ); // $ExpectError
211206
some.assign( x, true, y ); // $ExpectError
212207
some.assign( x, false, y ); // $ExpectError
213208
some.assign( x, null, y ); // $ExpectError
214209
some.assign( x, undefined, y ); // $ExpectError
215210
some.assign( x, [], y ); // $ExpectError
216211
some.assign( x, {}, y ); // $ExpectError
217212
some.assign( x, ( x: number ): number => x, y ); // $ExpectError
213+
214+
some.assign( x, '5', y, {} ); // $ExpectError
215+
some.assign( x, true, y, {} ); // $ExpectError
216+
some.assign( x, false, y, {} ); // $ExpectError
217+
some.assign( x, null, y, {} ); // $ExpectError
218+
some.assign( x, undefined, y, {} ); // $ExpectError
219+
some.assign( x, [], y, {} ); // $ExpectError
220+
some.assign( x, {}, y, {} ); // $ExpectError
221+
some.assign( x, ( x: number ): number => x, y, {} ); // $ExpectError
218222
}
219223

220224
// The compiler throws an error if the `assign` method is provided a third argument which is not an ndarray...
221225
{
222226
const x = zeros( [ 2, 2 ] );
223227

228+
some.assign( x, 2, '5' ); // $ExpectError
224229
some.assign( x, 2, 5 ); // $ExpectError
225230
some.assign( x, 2, true ); // $ExpectError
226231
some.assign( x, 2, false ); // $ExpectError
@@ -229,6 +234,16 @@ import some = require( './index' );
229234
some.assign( x, 2, {} ); // $ExpectError
230235
some.assign( x, 2, [ 1 ] ); // $ExpectError
231236
some.assign( x, 2, ( x: number ): number => x ); // $ExpectError
237+
238+
some.assign( x, 2, '5', {} ); // $ExpectError
239+
some.assign( x, 2, 5, {} ); // $ExpectError
240+
some.assign( x, 2, true, {} ); // $ExpectError
241+
some.assign( x, 2, false, {} ); // $ExpectError
242+
some.assign( x, 2, null, {} ); // $ExpectError
243+
some.assign( x, 2, undefined, {} ); // $ExpectError
244+
some.assign( x, 2, {}, {} ); // $ExpectError
245+
some.assign( x, 2, [ 1 ], {} ); // $ExpectError
246+
some.assign( x, 2, ( x: number ): number => x, {} ); // $ExpectError
232247
}
233248

234249
// The compiler throws an error if the `assign` method is provided an options argument which is not an object...

lib/node_modules/@stdlib/ndarray/some/lib/assign.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ var DEFAULT_DTYPE = defaults.get( 'dtypes.integer_index' );
8787
* });
8888
*
8989
* // Perform reduction:
90-
* var out = assign( x, 6.0, y );
90+
* var out = assign( x, 6, y );
9191
* // returns <ndarray>
9292
*
9393
* var v = out.get();

lib/node_modules/@stdlib/ndarray/some/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
* });
7878
*
7979
* // Perform reduction:
80-
* var out = some.assign( x, 6.0, y );
80+
* var out = some.assign( x, 6, y );
8181
* // returns <ndarray>
8282
*
8383
* var v = out.get();

lib/node_modules/@stdlib/ndarray/some/test/test.assign.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
var tape = require( 'tape' );
2424
var Float64Array = require( '@stdlib/array/float64' );
25+
var Float32Array = require( '@stdlib/array/float32' );
2526
var ndarray = require( '@stdlib/ndarray/ctor' );
2627
var empty = require( '@stdlib/ndarray/empty' );
2728
var ndarray2array = require( '@stdlib/ndarray/to-array' );
@@ -340,7 +341,7 @@ tape( 'the function throws an error if provided a second argument which is an nd
340341

341342
values = [
342343
new ndarray( 'float64', new Float64Array( [ 1 ] ), [ 1 ], [ 1 ], 0, 'row-major' ),
343-
new ndarray( 'float32', new Float64Array( [ 1 ] ), [ 1 ], [ 1 ], 0, 'row-major' )
344+
new ndarray( 'float32', new Float32Array( [ 1 ] ), [ 1 ], [ 1 ], 0, 'row-major' )
344345
];
345346

346347
for ( i = 0; i < values.length; i++ ) {
@@ -370,7 +371,7 @@ tape( 'the function throws an error if provided a second argument which is an nd
370371

371372
values = [
372373
new ndarray( 'float64', new Float64Array( [ 1 ] ), [ 1 ], [ 1 ], 0, 'row-major' ),
373-
new ndarray( 'float32', new Float64Array( [ 1 ] ), [ 1 ], [ 1 ], 0, 'row-major' )
374+
new ndarray( 'float32', new Float32Array( [ 1 ] ), [ 1 ], [ 1 ], 0, 'row-major' )
374375
];
375376

376377
for ( i = 0; i < values.length; i++ ) {

lib/node_modules/@stdlib/ndarray/some/test/test.main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var tape = require( 'tape' );
2424
var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
2525
var Float64Array = require( '@stdlib/array/float64' );
26+
var Float32Array = require( '@stdlib/array/float32' );
2627
var ndarray = require( '@stdlib/ndarray/ctor' );
2728
var empty = require( '@stdlib/ndarray/empty' );
2829
var ndarray2array = require( '@stdlib/ndarray/to-array' );
@@ -241,7 +242,7 @@ tape( 'the function throws an error if provided a second argument which is an nd
241242

242243
values = [
243244
new ndarray( 'float64', new Float64Array( [ 1 ] ), [ 1 ], [ 1 ], 0, 'row-major' ),
244-
new ndarray( 'float32', new Float64Array( [ 1 ] ), [ 1 ], [ 1 ], 0, 'row-major' )
245+
new ndarray( 'float32', new Float32Array( [ 1 ] ), [ 1 ], [ 1 ], 0, 'row-major' )
245246
];
246247

247248
for ( i = 0; i < values.length; i++ ) {
@@ -267,7 +268,7 @@ tape( 'the function throws an error if provided a second argument which is an nd
267268

268269
values = [
269270
new ndarray( 'float64', new Float64Array( [ 1 ] ), [ 1 ], [ 1 ], 0, 'row-major' ),
270-
new ndarray( 'float32', new Float64Array( [ 1 ] ), [ 1 ], [ 1 ], 0, 'row-major' )
271+
new ndarray( 'float32', new Float32Array( [ 1 ] ), [ 1 ], [ 1 ], 0, 'row-major' )
271272
];
272273

273274
for ( i = 0; i < values.length; i++ ) {

0 commit comments

Comments
 (0)