-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add stats/base/ndarray/sstdevwd
#9565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add stats/base/ndarray/sstdevwd
#9565
Conversation
---
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
---
|
Hello! Thank you for your contribution to stdlib. We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:
This acknowledgment confirms that you've read the guidelines, which include:
We can't review or accept contributions without this acknowledgment. Thank you for your understanding and cooperation. We look forward to reviewing your contribution! |
---
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: 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: na
- task: lint_license_headers
status: passed
---
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: passed
- 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: 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
---
stats/base/ndarray/sstdevwestats/base/ndarray/sstdevwd
Planeshifter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR is in good shape; thanks!
Left one comment that should be addressed.
| correction = scalar2ndarray( 1.0, opts ); | ||
|
|
||
| v = sstdevwd( [ vector( x, x.length, 1, 0 ), correction ] ); | ||
| v = sstdevwd( [ vector( x, x.length, 1, 0 ), correction ] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate function call. This line is identical to the one above and appears to be a copy-paste error. The same issue exists on lines 85-86.
| v = sstdevwd( [ vector( x, x.length, 1, 0 ), correction ] ); |
---
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: 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: na
- task: lint_license_headers
status: passed
---
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR! A few requests, otherwise looks good to me.
|
|
||
| var bench = require( '@stdlib/bench' ); | ||
| var uniform = require( '@stdlib/random/array/uniform' ); | ||
| var isnan = require( '@stdlib/math/base/assert/is-nan' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single-precision packages should use isnanf instead of isnan.
| var isnan = require( '@stdlib/math/base/assert/is-nan' ); | |
| var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); |
| b.tic(); | ||
| for ( i = 0; i < b.iterations; i++ ) { | ||
| v = sstdevwd( [ x, correction ] ); | ||
| if ( isnan( v ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be isnanf to match the single-precision import above.
| if ( isnan( v ) ) { | |
| if ( isnanf( v ) ) { |
| } | ||
| } | ||
| b.toc(); | ||
| if ( isnan( v ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here - use isnanf for consistency.
| if ( isnan( v ) ) { | |
| if ( isnanf( v ) ) { |
|
|
||
| #### sstdevwd( arrays ) | ||
|
|
||
| Computes the [standard deviation][standard-deviation] of a one-dimensional single-precision floating-point ndarray. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function description should include "using Welford's algorithm" to be consistent with the H1 title (line 23) and the JSDoc in lib/main.js (line 34).
| Computes the [standard deviation][standard-deviation] of a one-dimensional single-precision floating-point ndarray. | |
| Computes the [standard deviation][standard-deviation] of a one-dimensional single-precision floating-point ndarray using Welford's algorithm. |
| 'use strict'; | ||
|
|
||
| /** | ||
| * Compute the standard deviation of a one-dimensional single-precision floating-point ndarray. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The module description should include "using Welford's algorithm" to be consistent with lib/main.js (line 34).
| * Compute the standard deviation of a one-dimensional single-precision floating-point ndarray. | |
| * Compute the standard deviation of a one-dimensional single-precision floating-point ndarray using Welford's algorithm. |
| import { float32ndarray, typedndarray } from '@stdlib/types/ndarray'; | ||
|
|
||
| /** | ||
| * Computes the standard deviation of a one-dimensional single-precision floating-point ndarray. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function description should include "using Welford's algorithm" to be consistent with the package title and lib/main.js.
| * Computes the standard deviation of a one-dimensional single-precision floating-point ndarray. | |
| * Computes the standard deviation of a one-dimensional single-precision floating-point ndarray using Welford's algorithm. |
| Computes the standard deviation of a one-dimensional single-precision | ||
| floating-point ndarray. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function description should include "using Welford's algorithm" to be consistent with the package title and lib/main.js.
| Computes the standard deviation of a one-dimensional single-precision | |
| floating-point ndarray. | |
| Computes the standard deviation of a one-dimensional single-precision | |
| floating-point ndarray using Welford's algorithm. |
|
@Planeshifter, I’m not sure why this lint check is failing. Could you please take a look and let me know what’s going wrong? Also, I’d appreciate any guidance on how to avoid this for my upcoming contributions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DivyanshuVortex The EditorConfig linter tool cannot be installed for some reason. Unrelated to your changes here. We meant to look into reworking this to avoid re-downloading it in each lint run for a while. Please ignore for the time being if that job fails due to the installation failing.
PR looks good, so I will go ahead and merge. Thanks!
PR Commit MessagePlease review the above commit message and make any necessary adjustments. |
|
Ohh, I was a bit tense seeing that error and thought it might be something on my end. Thanks for confirming; that makes sense. I’ll ignore the EditorConfig lint job for now and proceed accordingly. |
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Resolves : none
Description
This pull request:
stats/base/ndarray/sstdevweRelated 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?
Disclosure
{{TODO: add disclosure if applicable}}
@stdlib-js/reviewers