-
-
Notifications
You must be signed in to change notification settings - Fork 698
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
added accessors.js, changed related files and added tests #5971
Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
@kgryte please let me know if further changes needed |
@@ -59,6 +64,11 @@ function variancech( N, correction, x, stride, offset ) { | |||
var n; | |||
var i; | |||
|
|||
// Check for accessor array: | |||
if ( x.get ) { |
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 isn't a sufficient check. Please follow what we do in other implementations supporting the accessor protocol.
ix = offset; | ||
|
||
// Use an estimate for the mean: | ||
mu = x.get( 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.
This is not what we want. Follow the conventions in other packages already having accessor protocol support.
*/ | ||
|
||
// MODULES // | ||
|
||
var ndarray = require( './ndarray.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.
Please study https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/max and emulate accordingly.
var v; | ||
|
||
x = { | ||
'get': function get( i ) { |
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 is not what we want. Use toAccessorArray
as in other implementations supporting accessor arrays. In short, emulate as closely as possible what we do in other packages.
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.
Left an initial round of comments. In short, you need to more closely emulate what we do in https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/max
Resolves #5688 .
Description
This pull request:
It passes all tests.
Related Issues
This pull request:
stats/base/variancech
#5688Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers