-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[RFC]: add stats/incr/nanmidrange #5578
Copy link
Copy link
Open
Labels
AcceptedRFC feature request which has been accepted.RFC feature request which has been accepted.FeatureIssue or pull request for adding a new feature.Issue or pull request for adding a new feature.Good First IssueA good first issue for new contributors!A good first issue for new contributors!JavaScriptIssue involves or relates to JavaScript.Issue involves or relates to JavaScript.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.StatisticsIssue or pull request related to statistical functionality.Issue or pull request related to statistical functionality.difficulty: 2May require some initial design or R&D, but should be straightforward to resolve and/or implement.May require some initial design or R&D, but should be straightforward to resolve and/or implement.priority: NormalNormal priority concern or feature request.Normal priority concern or feature request.
Metadata
Metadata
Assignees
Labels
AcceptedRFC feature request which has been accepted.RFC feature request which has been accepted.FeatureIssue or pull request for adding a new feature.Issue or pull request for adding a new feature.Good First IssueA good first issue for new contributors!A good first issue for new contributors!JavaScriptIssue involves or relates to JavaScript.Issue involves or relates to JavaScript.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.StatisticsIssue or pull request related to statistical functionality.Issue or pull request related to statistical functionality.difficulty: 2May require some initial design or R&D, but should be straightforward to resolve and/or implement.May require some initial design or R&D, but should be straightforward to resolve and/or implement.priority: NormalNormal priority concern or feature request.Normal priority concern or feature request.
Description
This RFC proposes adding a new package to the
stats/incr/*namespace:@stdlib/stats/incr/nanmidrange.This package is similar to
@stdlib/stats/incr/midrange, except that it performs special handling ofNaNvalues.Key Points
When implementing this package, you'll need to do the following:
Create package files
To see examples of similar packages, see
@stdlib/stats/incr/midrange(propagatesNaNvalues) and@stdlib/stats/incr/nansum(wraps aNaNpropagating accumulator and skipsNaNvalues).In particular notice how
nansumis a thin wrapper aroundsum. In most cases, this is what we are looking for.While the package proposed in this RFC will not match the implementations found in the above packages, those packages should provide a conceptual idea of what is desired. Do not simply copy-paste the code found in those packages without reasoning about expected behavior and API design.
Update source files
Once you've created package files, proceed to update all tests, documentation, and examples to reflect the API and expected behavior for the package. You should spend some time studying the tests in
@stdlib/stats/incr/midrange. We expect this package to have equivalent and fully comprehensive tests. The primary difference will be in the handling ofNaNvalues.To see an example of what is expected, study the tests in
@stdlib/stats/incr/sumand@stdlib/stats/incr/nansumCompare and contrast the tests in that pair of packages.
Run tests and other commands
For each of the following commands, please run them from the root stdlib repository directory (not the package folder!).
To run unit tests,
To run examples,
make examples EXAMPLES_FILTER=".*/stats/incr/nanmidrange/.*"To run benchmarks,
make benchmark BENCHMARKS_FILTER=".*/stats/incr/nanmidrange/.*"Create pull request
Provided all tests, examples, and benchmarks successfully execute and pass and that you've updated the package's documentation, you are now ready to open a pull request!
Notes
Checklist
[RFC]:.