Skip to content

Commit 53c0fc4

Browse files
committed
Auto-generated commit
1 parent b46e4d8 commit 53c0fc4

File tree

9 files changed

+219
-141
lines changed

9 files changed

+219
-141
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
### Features
1212

13+
- [`7b69002`](https://github.com/stdlib-js/stdlib/commit/7b69002e03bd424815f80e156e0994f150e80175) - ensure support for non-string dtypes and update tests to use functional accessors
1314
- [`aa9da1e`](https://github.com/stdlib-js/stdlib/commit/aa9da1e984009479baafb731970c49c0e2b0d423) - update `ndarray/base` TypeScript declarations [(#9935)](https://github.com/stdlib-js/stdlib/pull/9935)
1415
- [`3d21748`](https://github.com/stdlib-js/stdlib/commit/3d2174821f71a70dbb3052da07e0a3b3f6dfbaa0) - add function to return the index offset in units of elements
1516
- [`dd45a8f`](https://github.com/stdlib-js/stdlib/commit/dd45a8fcec70ba4716ec67606a448721a723f54b) - add function to return a dimension stride in units of elements
@@ -736,6 +737,7 @@ A total of 43 issues were closed in this release:
736737

737738
<details>
738739

740+
- [`7b69002`](https://github.com/stdlib-js/stdlib/commit/7b69002e03bd424815f80e156e0994f150e80175) - **feat:** ensure support for non-string dtypes and update tests to use functional accessors _(by Athan Reines)_
739741
- [`4794f9e`](https://github.com/stdlib-js/stdlib/commit/4794f9e933b2f3375daa7d74d856dd8af79ce5ea) - **test:** use functional accessors and ensure support for non-string dtypes _(by Athan Reines)_
740742
- [`91a321e`](https://github.com/stdlib-js/stdlib/commit/91a321e84c6925239d651a2b9824a2c4aa3a23ee) - **chore:** clean-up and allow non-string dtypes _(by Athan Reines)_
741743
- [`3762b83`](https://github.com/stdlib-js/stdlib/commit/3762b83d30536b528ba17199d81f9da0b3c09cf6) - **refactor:** reduce duplication _(by Athan Reines)_

base/from-scalar/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,19 @@ var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
4242

4343
#### scalar2ndarray( value, dtype, order )
4444

45-
Returns a zero-dimensional [`ndarray`][@stdlib/ndarray/base/ctor] containing a provided scalar `value` and having a specified [data type][@stdlib/ndarray/dtypes].
45+
Returns a zero-dimensional [ndarray][@stdlib/ndarray/base/ctor] containing a provided scalar `value` and having a specified [data type][@stdlib/ndarray/dtypes].
4646

4747
```javascript
48+
var getShape = require( '@stdlib/ndarray/shape' );
49+
var getDType = require( '@stdlib/ndarray/dtype' );
50+
4851
var x = scalar2ndarray( 1.0, 'float64', 'row-major' );
4952
// returns <ndarray>
5053

51-
var sh = x.shape;
54+
var sh = getShape( x );
5255
// returns []
5356

54-
var dt = x.dtype;
57+
var dt = String( getDType( x ) );
5558
// returns 'float64'
5659

5760
var v = x.get();
@@ -68,7 +71,7 @@ var v = x.get();
6871

6972
## Notes
7073

71-
- If `value` is a number and [`dtype`][@stdlib/ndarray/dtypes] is a complex [data type][@stdlib/ndarray/dtypes], the function returns a zero-dimensional [`ndarray`][@stdlib/ndarray/base/ctor] containing a complex number whose real component equals the provided scalar `value` and whose imaginary component is zero.
74+
- If `value` is a number and [`dtype`][@stdlib/ndarray/dtypes] is a complex [data type][@stdlib/ndarray/dtypes], the function returns a zero-dimensional [ndarray][@stdlib/ndarray/base/ctor] containing a complex number whose real component equals the provided scalar `value` and whose imaginary component is zero.
7275

7376
</section>
7477

@@ -87,7 +90,7 @@ var dtypes = require( '@stdlib/ndarray/dtypes' );
8790
var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
8891

8992
// Get a list of data types:
90-
var dt = dtypes();
93+
var dt = dtypes( 'integer_and_generic' );
9194

9295
// Generate zero-dimensional arrays...
9396
var x;

base/from-scalar/docs/repl.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
value: any
1313
Scalar value.
1414

15-
dtype: string
15+
dtype: string|DataType
1616
Data type.
1717

1818
order: string
@@ -27,10 +27,8 @@
2727
--------
2828
> var x = {{alias}}( 1.0, 'float64', 'row-major' )
2929
<ndarray>
30-
> var sh = x.shape
30+
> var sh = {{alias:@stdlib/ndarray/shape}}( x )
3131
[]
32-
> var dt = x.dtype
33-
'float64'
3432
> var v = x.get()
3533
1.0
3634

0 commit comments

Comments
 (0)