diff --git a/namespace/alias2pkg/coverage.ndjson b/namespace/alias2pkg/coverage.ndjson index 31fde15056..e88d52de37 100644 --- a/namespace/alias2pkg/coverage.ndjson +++ b/namespace/alias2pkg/coverage.ndjson @@ -13,3 +13,4 @@ [95,95,100,7,7,100,1,1,100,95,95,100,"6b48944663c08f64956469340e8561704d9923f8","2023-10-06 16:41:23 -0700"] [95,95,100,7,7,100,1,1,100,95,95,100,"3a44e7ebb576af7c0e301c6144f9be1d38ef2b8e","2023-10-06 18:57:34 -0700"] [95,95,100,7,7,100,1,1,100,95,95,100,"09306deea6b832fdc8b6bf11a853cf2c5eab8108","2023-10-07 01:30:44 -0700"] +[95,95,100,7,7,100,1,1,100,95,95,100,"88e58498365a51ba56218c74a4767e89eb5061cc","2023-10-08 01:23:05 -0700"] diff --git a/namespace/alias2pkg/index.html b/namespace/alias2pkg/index.html index ca3355bb7e..6a86e1d667 100644 --- a/namespace/alias2pkg/index.html +++ b/namespace/alias2pkg/index.html @@ -116,7 +116,7 @@

All files namespace/alias2pkg/lib

+ + + + + + \ No newline at end of file diff --git a/ndarray/base/dtype/index.js.html b/ndarray/base/dtype/index.js.html new file mode 100644 index 0000000000..4183a49a84 --- /dev/null +++ b/ndarray/base/dtype/index.js.html @@ -0,0 +1,220 @@ + + + + + + Code coverage report for ndarray/base/dtype/lib/index.js + + + + + + + + + +
+
+

All files / ndarray/base/dtype/lib index.js

+
+ +
+ 100% + Statements + 45/45 +
+ + +
+ 100% + Branches + 1/1 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 45/45 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +461x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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';
+ 
+/**
+* Return the data type of a provided ndarray.
+*
+* @module @stdlib/ndarray/base/dtype
+*
+* @example
+* var zeros = require( '@stdlib/ndarray/zeros' );
+* var dtype = require( '@stdlib/ndarray/base/dtype' );
+*
+* var x = zeros( [ 3, 3, 3 ], {
+*     'dtype': 'float64'
+* });
+*
+* var dt = dtype( x );
+* // returns 'float64'
+*/
+ 
+// MODULES //
+ 
+var main = require( './main.js' );
+ 
+ 
+// EXPORTS //
+ 
+module.exports = main;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/ndarray/base/dtype/main.js.html b/ndarray/base/dtype/main.js.html new file mode 100644 index 0000000000..3ab098fb69 --- /dev/null +++ b/ndarray/base/dtype/main.js.html @@ -0,0 +1,223 @@ + + + + + + Code coverage report for ndarray/base/dtype/lib/main.js + + + + + + + + + +
+
+

All files / ndarray/base/dtype/lib main.js

+
+ +
+ 100% + Statements + 46/46 +
+ + +
+ 100% + Branches + 2/2 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 46/46 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +471x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +12x +12x +12x +1x +1x +1x +1x +1x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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';
+ 
+// MAIN //
+ 
+/**
+* Returns the data type of a provided ndarray.
+*
+* @param {ndarrayLike} x - input ndarray
+* @returns {string} data type
+*
+* @example
+* var zeros = require( '@stdlib/ndarray/zeros' );
+*
+* var x = zeros( [ 3, 3, 3 ], {
+*     'dtype': 'float64'
+* });
+*
+* var dt = dtype( x );
+* // returns 'float64'
+*/
+function dtype( x ) {
+	return x.dtype;
+}
+ 
+ 
+// EXPORTS //
+ 
+module.exports = dtype;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/ndarray/base/index.html b/ndarray/base/index.html index 76ade6d3ec..92f9529b95 100644 --- a/ndarray/base/index.html +++ b/ndarray/base/index.html @@ -25,7 +25,7 @@

All files ndarray/base/lib

100% Statements - 694/694 + 703/703
@@ -46,7 +46,7 @@

All files ndarray/base/lib

100% Lines - 694/694 + 703/703
@@ -84,13 +84,13 @@

All files ndarray/base/lib

100% - 694/694 + 703/703 100% 1/1 100% 0/0 100% - 694/694 + 703/703 @@ -101,7 +101,7 @@

All files ndarray/base/lib

+ + + + + + \ No newline at end of file diff --git a/ndarray/dtype/index.js.html b/ndarray/dtype/index.js.html new file mode 100644 index 0000000000..9d5912711a --- /dev/null +++ b/ndarray/dtype/index.js.html @@ -0,0 +1,220 @@ + + + + + + Code coverage report for ndarray/dtype/lib/index.js + + + + + + + + + +
+
+

All files / ndarray/dtype/lib index.js

+
+ +
+ 100% + Statements + 45/45 +
+ + +
+ 100% + Branches + 1/1 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 45/45 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +461x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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';
+ 
+/**
+* Return the data type of a provided ndarray.
+*
+* @module @stdlib/ndarray/dtype
+*
+* @example
+* var zeros = require( '@stdlib/ndarray/zeros' );
+* var dtype = require( '@stdlib/ndarray/dtype' );
+*
+* var x = zeros( [ 3, 3, 3 ], {
+*     'dtype': 'float64'
+* });
+*
+* var dt = dtype( x );
+* // returns 'float64'
+*/
+ 
+// MODULES //
+ 
+var main = require( './main.js' );
+ 
+ 
+// EXPORTS //
+ 
+module.exports = main;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/ndarray/dtype/main.js.html b/ndarray/dtype/main.js.html new file mode 100644 index 0000000000..f600e72f33 --- /dev/null +++ b/ndarray/dtype/main.js.html @@ -0,0 +1,277 @@ + + + + + + Code coverage report for ndarray/dtype/lib/main.js + + + + + + + + + +
+
+

All files / ndarray/dtype/lib main.js

+
+ +
+ 100% + Statements + 64/64 +
+ + +
+ 100% + Branches + 7/7 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 64/64 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +651x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +24x +24x +24x +24x +24x +8x +8x +16x +24x +12x +12x +4x +4x +24x +1x +1x +1x +1x +1x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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 isDataType = require( '@stdlib/ndarray/base/assert/is-data-type' );
+var format = require( '@stdlib/string/format' );
+ 
+ 
+// MAIN //
+ 
+/**
+* Returns the data type of a provided ndarray.
+*
+* @param {ndarrayLike} x - input ndarray
+* @throws {TypeError} must provide an ndarray having a supported data type
+* @returns {string} data type
+*
+* @example
+* var zeros = require( '@stdlib/ndarray/zeros' );
+*
+* var x = zeros( [ 3, 3, 3 ], {
+*     'dtype': 'float64'
+* });
+*
+* var dt = dtype( x );
+* // returns 'float64'
+*/
+function dtype( x ) {
+	var dt;
+ 
+	// Note: we intentionally avoid rigorous ndarray checks to minimize performance impacts. This obviously means that non-ndarray-like objects can sneak through, but this is likely all right for the purposes of this function...
+	if ( typeof x !== 'object' || x === null ) {
+		throw new TypeError( format( 'invalid argument. Must provide an ndarray. Value: `%s`.', x ) );
+	}
+	dt = x.dtype;
+	if ( isDataType( dt ) ) {
+		return dt;
+	}
+	// A data type is essential for interpreting the memory associated with an ndarray object, so no fallbacks or workarounds for data type resolution...
+	throw new TypeError( format( 'invalid argument. Must provide an ndarray having a supported data type. Value: `%s`.', dt ) );
+}
+ 
+ 
+// EXPORTS //
+ 
+module.exports = dtype;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/ndarray/index.html b/ndarray/index.html index fb4fc5a40e..5f536b535a 100644 --- a/ndarray/index.html +++ b/ndarray/index.html @@ -25,7 +25,7 @@

All files ndarray/lib

100% Statements - 348/348 + 357/357
@@ -46,7 +46,7 @@

All files ndarray/lib

100% Lines - 348/348 + 357/357
@@ -84,13 +84,13 @@

All files ndarray/lib

100% - 348/348 + 357/357 100% 1/1 100% 0/0 100% - 348/348 + 357/357 @@ -101,7 +101,7 @@

All files ndarray/lib