From f0f17b72a227af1c81392e6d6628f3abc569d578 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 20 May 2026 12:23:10 +0000 Subject: [PATCH 1/3] fix: only fall back to default order for ambiguous strides in `ndarray/base/order` When `strides2order` returns `1`, the strides are unambiguously row-major and should yield `'row-major'` regardless of the configured default order. Only the `o === 3` "both row- and column-major" case is ambiguous and should fall back to the default. --- lib/node_modules/@stdlib/ndarray/base/order/lib/main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/order/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/order/lib/main.js index 75ccc0afb147..0a5fd45df4de 100644 --- a/lib/node_modules/@stdlib/ndarray/base/order/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/base/order/lib/main.js @@ -64,12 +64,15 @@ function order( x ) { return ROW_MAJOR; // WARNING: default to row-major for ndarray-like objects lacking strides. This may or may not be accurate, and we're defaulting to row-major here based on the belief that row-major is more likely given that, e.g., JavaScript arrays are similar to C arrays (i.e., stored in row-major order). } o = strides2order( st ); - if ( o === 1 || o === 3 ) { - return DEFAULT_ORDER; // for o == 3 (both row- and column-major; e.g., one-dimensional ndarrays), default to the default order + if ( o === 1 ) { + return ROW_MAJOR; } if ( o === 2 ) { return COLUMN_MAJOR; } + if ( o === 3 ) { + return DEFAULT_ORDER; // both row- and column-major (e.g., one-dimensional ndarrays); default to the default order + } // o === 0 if ( x.shape.length === 0 ) { return DEFAULT_ORDER; // default to the default order for zero-dimensional ndarrays From fb552d033e9e2a2cd3b05f75548dff2784376f14 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 20 May 2026 12:23:14 +0000 Subject: [PATCH 2/3] docs: fix signature in `ndarray/base/ndarraylike2descriptor` README The function takes a single ndarray-like argument; the heading was showing the descriptor field list instead of the actual parameter. --- .../@stdlib/ndarray/base/ndarraylike2descriptor/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/ndarraylike2descriptor/README.md b/lib/node_modules/@stdlib/ndarray/base/ndarraylike2descriptor/README.md index 2cb5e92b57ff..113f9e545596 100644 --- a/lib/node_modules/@stdlib/ndarray/base/ndarraylike2descriptor/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/ndarraylike2descriptor/README.md @@ -40,7 +40,7 @@ limitations under the License. var ndarraylike2descriptor = require( '@stdlib/ndarray/base/ndarraylike2descriptor' ); ``` -#### ndarraylike2descriptor( dtype, buffer, shape, strides, offset, order ) +#### ndarraylike2descriptor( x ) Converts an ndarray-like object to an ndarray [descriptor][@stdlib/ndarray/base/descriptor]. From 6f5d25863a3573d90dd4588a9b71d0d3bed5eb6c Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 20 May 2026 12:23:19 +0000 Subject: [PATCH 3/3] docs: fix `ndarraylike2descriptor` signature in `ndarray/base` namespace TOC The TOC entry showed the descriptor field list as the argument list; the function takes a single ndarray-like argument. --- lib/node_modules/@stdlib/ndarray/base/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/README.md b/lib/node_modules/@stdlib/ndarray/base/README.md index 7ef8585d23f4..19c0c2799d73 100644 --- a/lib/node_modules/@stdlib/ndarray/base/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/README.md @@ -140,7 +140,7 @@ var o = ns; - [`minmaxViewBufferIndex( shape, strides, offset )`][@stdlib/ndarray/base/minmax-view-buffer-index]: compute the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view. - [`nansLike( x )`][@stdlib/ndarray/base/nans-like]: create a NaN-filled ndarray having the same shape and data type as a provided ndarray. - [`nans( dtype, shape, order )`][@stdlib/ndarray/base/nans]: create a NaN-filled ndarray having a specified shape and data type. -- [`ndarraylike2descriptor( dtype, buffer, shape, strides, offset, order )`][@stdlib/ndarray/base/ndarraylike2descriptor]: convert an ndarray-like object to an ndarray descriptor. +- [`ndarraylike2descriptor( x )`][@stdlib/ndarray/base/ndarraylike2descriptor]: convert an ndarray-like object to an ndarray descriptor. - [`ndarraylike2ndarray( x )`][@stdlib/ndarray/base/ndarraylike2ndarray]: convert an ndarray-like object to an `ndarray`. - [`ndarraylike2object( x )`][@stdlib/ndarray/base/ndarraylike2object]: convert an `ndarray`-like object to an object likely to have the same "shape". - [`ndarraylike2scalar( x )`][@stdlib/ndarray/base/ndarraylike2scalar]: convert an ndarray-like object to a scalar value.