Skip to content

Commit e7a0669

Browse files
committed
refactor: normalize input ndarrays to ensure expected get/set methods
--- 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: passed - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent dc22256 commit e7a0669

File tree

1 file changed

+6
-2
lines changed
  • lib/node_modules/@stdlib/ndarray/base/zip2views1d/lib

1 file changed

+6
-2
lines changed

lib/node_modules/@stdlib/ndarray/base/zip2views1d/lib/main.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
2424
var setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );
2525
var copy = require( '@stdlib/array/base/copy' );
26+
var ndarraylike2ndarray = require( '@stdlib/ndarray/base/ndarraylike2ndarray' );
2627
var numel = require( '@stdlib/ndarray/numel' );
2728

2829

@@ -37,7 +38,7 @@ var numel = require( '@stdlib/ndarray/numel' );
3738
* - The list of provided labels should equal the number of ndarrays to be zipped.
3839
* - Each view in the returned array shares the same memory as the corresponding elements in the input ndarrays. Accordingly, mutation of either an input ndarray or a view will mutate the other.
3940
*
40-
* @param {ArrayLikeObject<ndarray>} arrays - list of ndarrays to be zipped
41+
* @param {ArrayLikeObject<ndarrayLike>} arrays - list of ndarrays to be zipped
4142
* @param {ArrayLikeObject<string>} labels - list of labels
4243
* @returns {Array<Object>} output array
4344
*
@@ -90,7 +91,10 @@ function zip2views1d( arrays, labels ) {
9091
if ( M < 1 ) {
9192
return [];
9293
}
93-
list = copy( arrays );
94+
list = [];
95+
for ( i = 0; i < M; i++ ) {
96+
list.push( ndarraylike2ndarray( arrays[ i ] ) );
97+
}
9498
N = numel( list[ 0 ] );
9599
if ( N < 1 ) {
96100
return [];

0 commit comments

Comments
 (0)