-
-
Notifications
You must be signed in to change notification settings - Fork 758
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
#6048
feat: add accessor protocol support and refactor stats/base/nanvariancech
#6048
Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
if ( N <= 0 ) { | ||
return 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.
if ( N <= 0 ) { | |
return NaN; | |
} |
this is already being checked for in ndarray.js
|
||
// Find an estimate for the mean... | ||
for ( i = 0; i < N; i++ ) { | ||
v = xget( xbuf, ix); |
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 = xget( xbuf, ix); | |
v = xget( xbuf, ix ); |
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.
kindly refer to this to see how we write examples. also, use generic
data type instead of float64
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.
why are you deleting this file...
|
||
```javascript | ||
var floor = require( '@stdlib/math/base/special/floor' ); | ||
|
||
var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.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.
var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; | |
var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, 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.
we should explicitly show how we're handling the NaN
element
|
||
var v = nanvariancech.ndarray( N, 1, x, 2, 1 ); | ||
var v = nanvariancech.ndarray( 4, 1, x, 2, 1 ); |
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.ndarray( 4, 1, x, 2, 1 ); | |
var v = nanvariancech.ndarray( 5, 1, x, 2, 1 ); |
var round = require( '@stdlib/math/base/special/round' ); | ||
var Float64Array = require( '@stdlib/array/float64' ); | ||
var normal = require( '@stdlib/random/array/normal' ); | ||
var nanvariancech = require( '@stdlib/stats/base/nanvariancech' ); | ||
|
||
var x; | ||
var i; | ||
|
||
x = new Float64Array( 10 ); | ||
for ( i = 0; i < x.length; i++ ) { | ||
x[ i ] = round( (randu()*100.0) - 50.0 ); | ||
} | ||
var x = normal( 10, 0, 1 ); | ||
x[4] = 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.
same comments as examples/index.js
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.
kindly use this as a reference
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 comments for your other benchmark file
stats/base/nanvariancech
--- 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: passed - 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: na - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
Hi @aayush0325, i have implemented the requested changes. Please let me know if you need any further modification. |
kindly address the CI failure errors before further review, this saves a lot of time for both of us! thank you :) |
--- 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
5c97c25
to
06fc847
Compare
Hi @aayush0325, I’m sorry for any confusion caused. this branch was removed to address some concerns. A new PR #6167 is now available with the requested changes. Sorry again ! |
…riancech
Resolves #5674 .
Description
This pull request:
lib/accessors.js
.lib/ndaaray.js
.lib/nanvariancech
.Related Issues
This pull request:
stats/base/nanvariancech
#5674Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers