-
-
Notifications
You must be signed in to change notification settings - Fork 807
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 accessor protocol support and refactor stats/base/nanvariancech
#6167
base: develop
Are you sure you want to change the base?
feat: add accessor protocol support and refactor stats/base/nanvariancech
#6167
Conversation
…cech --- 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: 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 ---
Coverage Report
The above coverage report was generated for the changes in this PR. |
var N = floor( x0.length / 2 ); | ||
|
||
var v = nanvariancech( N, 1, x1, 2 ); | ||
var v = nanvariancech( 4, 1, x1, 2 ); |
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.
var v = nanvariancech( 4, 1, x1, 2 ); | |
var v = nanvariancech( 5, 1, x1, 2 ); |
|
||
var v = nanvariancech( N, 1, x, 2 ); | ||
var v = nanvariancech( 4, 1, x, 2 ); |
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.
var v = nanvariancech( 4, 1, x, 2 ); | |
var v = nanvariancech( 5, 1, x, 2 ); |
we should be traversing over the NaN
value so that the example can demonstrate how the algorithm deals with it
Computes the variance of a strided array ignoring `NaN` values and using a | ||
one-pass trial mean algorithm. | ||
|
||
The `N` and `stride` parameters determine which elements in `x` are accessed | ||
at runtime. | ||
The `N` and stride parameters determine which elements in the strided arrays |
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 `N` and stride parameters determine which elements in the strided arrays | |
The `N` and stride parameters determine which elements in the strided array |
there's only 1 array here
@@ -46,31 +46,28 @@ | |||
-------- | |||
// Standard Usage: | |||
> var x = [ 1.0, -2.0, NaN, 2.0 ]; | |||
> {{alias}}( x.length, 1, x, 1 ) | |||
> {{alias}}( 4, 1, x, 1 ) | |||
~4.3333 | |||
|
|||
// Using `N` and `stride` parameters: | |||
> x = [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0 ]; |
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.
Add a NaN
element in the array and traverse over it to show that we're ignoring it
> var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); | ||
> var stride = 2; | ||
> {{alias}}( N, 1, x, stride ) | ||
> {{alias}}( 3, 1, x, 2 ) | ||
~4.3333 | ||
|
||
// Using view offsets: | ||
> var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] ); |
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.
similar comment regarding NaN
values
buffer, the `offset` parameter supports indexing semantics based on a | ||
starting index. | ||
buffer, the offset parameters support indexing semantics based on a | ||
starting indices. |
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.
starting indices. | |
starting index. |
@@ -108,13 +105,12 @@ | |||
-------- | |||
// Standard Usage: | |||
> var x = [ 1.0, -2.0, NaN, 2.0 ]; | |||
> {{alias}}.ndarray( x.length, 1, x, 1, 0 ) | |||
> {{alias}}.ndarray( 4, 1, x, 1, 0 ) | |||
~4.3333 | |||
|
|||
// Using offset parameter: | |||
> var x = [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ]; |
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.
similar comment regarding NaN
values
NaN | ||
]; | ||
|
||
v = nanvariancech( 4, 1, toAccessorArray( x ), 2 ); |
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.
v = nanvariancech( 4, 1, toAccessorArray( x ), 2 ); | |
v = nanvariancech( 5, 1, toAccessorArray( x ), 2 ); |
notice in the comments that the indices which should be traversed are mentioned, kindly follow that
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 for all other instances.
@@ -230,15 +352,36 @@ tape( 'the function supports a `stride` parameter', function test( t ) { | |||
NaN | |||
]; | |||
|
|||
N = floor( x.length / 2 ); | |||
v = nanvariancech( N, 1, x, 2 ); | |||
v = nanvariancech( 4, 1, x, 2 ); |
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.
v = nanvariancech( 4, 1, x, 2 ); | |
v = nanvariancech( 5, 1, x, 2 ); |
|
||
v = nanvariancech( N, 1, x1, 2 ); | ||
v = nanvariancech( 4, 1, x1, 2 ); |
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.
v = nanvariancech( 4, 1, x1, 2 ); | |
v = nanvariancech( 5, 1, x1, 2 ); |
kindly follow the commented indices, same comment for all other instances
kindly resolve the merge conflicts in readme as well |
--- 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: 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
conflicts in README haven't been resolved |
kindly match the file structure that we're following, your |
--- 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: 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
Hi @aayush0325 , I have addressed requested changes. let me know if you want further modification. |
…cech
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Resolves #5674 .
Description
This pull request:
accessors.js
files.lib/nanvariancech
.lib/ndarray.js
Related Issues
This pull request:
stats/base/nanvariancech
#5674Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers