Skip to content

Commit fee281b

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: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - 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: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent db2e2f5 commit fee281b

8 files changed

Lines changed: 128 additions & 113 deletions

File tree

lib/node_modules/@stdlib/ndarray/from-scalar-like/README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ var out = scalar2ndarrayLike( x, 1.0 );
5959
var sh = getShape( out );
6060
// returns []
6161

62-
var dt = getDType( out );
62+
var dt = String( getDType( out ) );
6363
// returns 'float64'
6464
```
6565

@@ -68,11 +68,11 @@ The function accepts the following arguments:
6868
- **x**: input [ndarray][@stdlib/ndarray/ctor].
6969
- **value**: scalar value.
7070

71-
The function accepts the following `options`:
71+
The function accepts the following options:
7272

7373
- **dtype**: output array [data type][@stdlib/ndarray/dtypes].
74-
- **order**: array order (i.e., memory layout), which is either `row-major` (C-style) or `column-major` (Fortran-style). Default: `'row-major'`.
75-
- **readonly**: `boolean` indicating whether an array should be **read-only**. Default: `false`.
74+
- **order**: array order (i.e., memory layout), which is either `row-major` (C-style) or `column-major` (Fortran-style).
75+
- **readonly**: boolean indicating whether an array should be **read-only**. Default: `false`.
7676

7777
If a `dtype` option is not provided and `value`
7878

@@ -82,7 +82,7 @@ If a `dtype` option is not provided and `value`
8282
- is a complex number object of an unknown data type, the default [data type][@stdlib/ndarray/dtypes] is the [default][@stdlib/ndarray/defaults] complex-valued floating-point data type.
8383
- is any other value type, the default [data type][@stdlib/ndarray/dtypes] is `'generic'`.
8484

85-
To explicitly specify the [data type][@stdlib/ndarray/dtypes] of the returned [`ndarray`][@stdlib/ndarray/ctor], provide a `dtype` option.
85+
To explicitly specify the [data type][@stdlib/ndarray/dtypes] of the returned [ndarray][@stdlib/ndarray/ctor], provide a `dtype` option.
8686

8787
```javascript
8888
var getShape = require( '@stdlib/ndarray/shape' );
@@ -100,7 +100,7 @@ var out = scalar2ndarrayLike( x, 1.0, {
100100
var sh = getShape( out );
101101
// returns []
102102

103-
var dt = getDType( out );
103+
var dt = String( getDType( out ) );
104104
// returns 'float32'
105105
```
106106

@@ -114,7 +114,7 @@ var dt = getDType( out );
114114

115115
## Notes
116116

117-
- If `value` is a number and `options.dtype` is a complex [data type][@stdlib/ndarray/dtypes], the function returns a zero-dimensional [`ndarray`][@stdlib/ndarray/ctor] containing a complex number whose real component equals the provided scalar `value` and whose imaginary component is zero.
117+
- If `value` is a number and `options.dtype` is a complex [data type][@stdlib/ndarray/dtypes], the function returns a zero-dimensional [ndarray][@stdlib/ndarray/ctor] containing a complex number whose real component equals the provided scalar `value` and whose imaginary component is zero.
118118
- The function does not guard against precision loss when `value` is a number and the `dtype` argument is an integer [data type][@stdlib/ndarray/dtypes].
119119

120120
</section>
@@ -137,12 +137,13 @@ var scalar2ndarrayLike = require( '@stdlib/ndarray/from-scalar-like' );
137137
// Get a list of data types:
138138
var dt = dtypes( 'integer_and_generic' );
139139

140+
// Create an input array:
141+
var x = empty( [ 2, 2 ] );
142+
140143
// Generate zero-dimensional arrays...
141-
var x;
142144
var y;
143145
var i;
144146
for ( i = 0; i < dt.length; i++ ) {
145-
x = empty( [ 2, 2 ] );
146147
y = scalar2ndarrayLike( x, i, {
147148
'dtype': dt[ i ]
148149
});

lib/node_modules/@stdlib/ndarray/from-scalar-like/docs/repl.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@
1919
options: Object (optional)
2020
Options.
2121

22-
options.dtype: string (optional)
22+
options.dtype: string|DataType (optional)
2323
Data type. If not provided and `value`
2424

2525
- is a number, the default data type is the default real-valued
26-
floating-point data type.
26+
floating-point data type.
2727
- is a boolean, the default data type is the default boolean data type.
2828
- is a complex number object of a known complex data type, the data type
29-
is the same as the provided value.
29+
is the same as the provided value.
3030
- is a complex number object of an unknown data type, the default data
31-
type is the default complex-valued floating-point data type.
31+
type is the default complex-valued floating-point data type.
3232
- is any other value type, the default data type is 'generic'.
3333

3434
options.order: string (optional)
3535
Specifies whether an array is row-major (C-style) or column-major
36-
(Fortran-style). Default: 'row-major'.
36+
(Fortran-style).
3737

3838
options.readonly: boolean (optional)
3939
Boolean indicating whether an array should be read-only. Default: false.
@@ -47,12 +47,8 @@
4747
--------
4848
> var x = {{alias:@stdlib/ndarray/array}}( [ 1.0, 2.0, 3.0 ] )
4949
<ndarray>[ 1.0, 2.0, 3.0 ]
50-
> var x = {{alias}}( x, 1.0, { 'dtype': 'float64' } )
50+
> var x = {{alias}}( x, 1.0 )
5151
<ndarray>[ 1.0 ]
52-
> var sh = {{alias:@stdlib/ndarray/shape}}( x )
53-
[]
54-
> var dt = {{alias:@stdlib/ndarray/dtype}}( x )
55-
'float64'
5652

5753
See Also
5854
--------

0 commit comments

Comments
 (0)