feat: add stats/base/ndarray/sdsnanmean#9635
feat: add stats/base/ndarray/sdsnanmean#9635aryan7071 wants to merge 8 commits intostdlib-js:developfrom
stats/base/ndarray/sdsnanmean#9635Conversation
---
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: passed
- 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: passed
- 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
---
---
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: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: passed
- 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
---
|
/stdlib update-copyright-years |
Coverage Report
The above coverage report was generated for the changes in this PR. |
---
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: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: passed
- task: lint_javascript_src
status: na
- 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
---
---
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: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- 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: passed
- task: lint_license_headers
status: passed
---
stats/base/ndarray/sdsnanmean
---
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: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: passed
- 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
---
---
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: na
- 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: passed
- task: lint_license_headers
status: passed
---
Planeshifter
left a comment
There was a problem hiding this comment.
Left a bunch of small documentation requests to follow existing conventions more closely.
| { | ||
| "name": "@stdlib/stats/base/ndarray/sdsnanmean", | ||
| "version": "0.0.0", | ||
| "description": "Compute the mean of a one-dimensional single-precision floating-point ndarray, ignoring `NaN` values.", |
There was a problem hiding this comment.
The description should say "arithmetic mean" instead of just "mean" to match the pattern in similar packages like snanmean.
| "description": "Compute the mean of a one-dimensional single-precision floating-point ndarray, ignoring `NaN` values.", | |
| "description": "Compute the arithmetic mean of a one-dimensional single-precision floating-point ndarray, ignoring `NaN` values.", |
| "math", | ||
| "mean", | ||
| "central tendency", |
There was a problem hiding this comment.
Missing a few standard keywords that are present in similar packages (snanmean, dnanmean). Let's add "average", "avg", and "arithmetic mean" to match the established pattern.
| "math", | |
| "mean", | |
| "central tendency", | |
| "math", | |
| "average", | |
| "avg", | |
| "mean", | |
| "arithmetic mean", | |
| "central tendency", |
|
|
||
| # sdsnanmean | ||
|
|
||
| > Compute the mean of a one-dimensional single-precision floating-point ndarray, ignoring `NaN` values. |
There was a problem hiding this comment.
This should use the hyperlinked "[arithmetic mean][arithmetic-mean]" format and include the equation section, matching the pattern in snanmean/README.md. The title line should be:
> Compute the [arithmetic mean][arithmetic-mean] of a one-dimensional single-precision floating-point ndarray, ignoring `NaN` values.And you'll also need to add the equation section after line 25 (similar to the one in snanmean/README.md lines 27-41) and the link definition at the end:
[arithmetic-mean]: https://en.wikipedia.org/wiki/Arithmetic_mean|
|
||
| #### sdsnanmean( arrays ) | ||
|
|
||
| Computes the mean of a one-dimensional single-precision floating-point ndarray, ignoring NaN values. |
There was a problem hiding this comment.
This should also use the hyperlinked format to match the reference packages.
| Computes the mean of a one-dimensional single-precision floating-point ndarray, ignoring NaN values. | |
| Computes the [arithmetic mean][arithmetic-mean] of a one-dimensional single-precision floating-point ndarray, ignoring `NaN` values. |
| * Computes the arithmetic mean of a one-dimensional single-precision floating-point ndarray, ignoring `NaN` values. | ||
| * | ||
| * @param {ArrayLikeObject<Object>} arrays - array-like object containing an input ndarray | ||
| * @returns {number} computed mean |
There was a problem hiding this comment.
For consistency with reference packages, the @returns description should use "arithmetic mean" rather than "computed mean".
| * @returns {number} computed mean | |
| * @returns {number} arithmetic mean |
| * Computes the mean of a one-dimensional single-precision floating-point ndarray, ignoring `NaN` values. | ||
| * | ||
| * @param arrays - array-like object containing an input ndarray | ||
| * @returns computed mean |
There was a problem hiding this comment.
The @returns description should be "arithmetic mean" to match reference packages.
| * @returns computed mean | |
| * @returns arithmetic mean |
| * var v = sdsnanmean( [ x ] ); | ||
| * // returns <number> |
There was a problem hiding this comment.
The example should show the actual expected return value rather than <number>. Looking at the input [ 1.0, 3.0, NaN, 2.0 ], the mean of the non-NaN values (1.0, 3.0, 2.0) is 2.0.
| * var v = sdsnanmean( [ x ] ); | |
| * // returns <number> | |
| * var v = sdsnanmean( [ x ] ); | |
| * // returns 2.0 |
| {{alias}}( arrays ) | ||
| Computes the mean of a one-dimensional single-precision floating-point | ||
| ndarray, ignoring `NaN` values. |
There was a problem hiding this comment.
This should say "arithmetic mean" to match the pattern in reference packages like snanmean.
| {{alias}}( arrays ) | |
| Computes the mean of a one-dimensional single-precision floating-point | |
| ndarray, ignoring `NaN` values. | |
| {{alias}}( arrays ) | |
| Computes the arithmetic mean of a one-dimensional single-precision floating- | |
| point ndarray, ignoring `NaN` values. |
| Returns | ||
| ------- | ||
| out: number | ||
| Computed mean. |
There was a problem hiding this comment.
The return description should be "Arithmetic mean." to match the pattern in reference packages.
| Computed mean. | |
| Arithmetic mean. |
|
|
||
| return benchmark; | ||
|
|
||
| function benchmark( b ) { |
There was a problem hiding this comment.
The inner benchmark function is missing its JSDoc documentation. In reference packages like snanmean/benchmark/benchmark.js, this function has a JSDoc block (lines 65-70). Please add:
/**
* Benchmark function.
*
* @private
* @param {Benchmark} b - benchmark instance
*/
function benchmark( b ) {---
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: passed
- 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: passed
- task: lint_license_headers
status: passed
---
Description
This pull request:
Related Issues
This pull request has the following related issues:
Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
@stdlib-js/reviewers