Skip to content

Commit 090adaa

Browse files
committed
fix: ensure output dtype can only be real-valued floating-point or generic
--- 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: 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 167bba8 commit 090adaa

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

lib/node_modules/@stdlib/stats/mean/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The function has the following parameters:
7575
The function accepts the following options:
7676

7777
- **dims**: list of dimensions over which to perform a reduction. If not provided, the function performs a reduction over all elements in a provided input [ndarray][@stdlib/ndarray/ctor].
78-
- **dtype**: output ndarray [data type][@stdlib/ndarray/dtypes]. Must be a real-valued or "generic" [data type][@stdlib/ndarray/dtypes].
78+
- **dtype**: output ndarray [data type][@stdlib/ndarray/dtypes]. Must be a real-valued floating-point or "generic" [data type][@stdlib/ndarray/dtypes].
7979
- **keepdims**: boolean indicating whether the reduced dimensions should be included in the returned [ndarray][@stdlib/ndarray/ctor] as singleton dimensions. Default: `false`.
8080

8181
By default, the function performs a reduction over all elements in a provided input [ndarray][@stdlib/ndarray/ctor]. To perform a reduction over specific dimensions, provide a `dims` option.
@@ -217,7 +217,7 @@ The method accepts the following options:
217217
## Notes
218218

219219
- Setting the `keepdims` option to `true` can be useful when wanting to ensure that the output [ndarray][@stdlib/ndarray/ctor] is [broadcast-compatible][@stdlib/ndarray/base/broadcast-shapes] with ndarrays having the same shape as the input [ndarray][@stdlib/ndarray/ctor].
220-
- The output data type [policy][@stdlib/ndarray/output-dtype-policies] only applies to the main function and specifies that, by default, the function must return an [ndarray][@stdlib/ndarray/ctor] having the same [data type][@stdlib/ndarray/dtypes] as the input [ndarray][@stdlib/ndarray/ctor]. For the `assign` method, the output [ndarray][@stdlib/ndarray/ctor] is allowed to have any supported output [data type][@stdlib/ndarray/dtypes].
220+
- The output data type [policy][@stdlib/ndarray/output-dtype-policies] only applies to the main function and specifies that, by default, the function must return an [ndarray][@stdlib/ndarray/ctor] having a real-valued floating-point or "generic" [data type][@stdlib/ndarray/dtypes]. For the `assign` method, the output [ndarray][@stdlib/ndarray/ctor] is allowed to have any supported output [data type][@stdlib/ndarray/dtypes].
221221

222222
</section>
223223

lib/node_modules/@stdlib/stats/mean/docs/repl.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
Function options.
1212

1313
options.dtype: string (optional)
14-
Output array data type. Must be a real-valued or "generic" data type.
14+
Output array data type. Must be a real floating-point or "generic" data
15+
type.
1516

1617
options.dims: Array<integer> (optional)
1718
List of dimensions over which to perform a reduction. If not provided,

lib/node_modules/@stdlib/stats/mean/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/// <reference types="@stdlib/types"/>
2222

2323
import { ArrayLike } from '@stdlib/types/array';
24-
import { RealAndGenericDataType as DataType, typedndarray } from '@stdlib/types/ndarray';
24+
import { RealFloatingPointAndGenericDataType as DataType, typedndarray } from '@stdlib/types/ndarray';
2525

2626
/**
2727
* Input array.

lib/node_modules/@stdlib/stats/mean/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ var factory = require( '@stdlib/ndarray/base/unary-reduce-strided1d-dispatch-fac
3030
// VARIABLES //
3131

3232
var idtypes = dtypes( 'real_and_generic' );
33-
var odtypes = dtypes( 'real_and_generic' );
33+
var odtypes = dtypes( 'real_floating_point_and_generic' );
3434
var policies = {
35-
'output': 'same',
35+
'output': 'real_floating_point_and_generic',
3636
'casting': 'none'
3737
};
3838
var table = {

0 commit comments

Comments
 (0)