-
-
Notifications
You must be signed in to change notification settings - Fork 733
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
[RFC]: add stats/incr/nanmhmean
#5577
Comments
👋 Important: PLEASE READ 👋This issue has been labeled as a good first issue and is available for anyone to work on. If this is your first time contributing to an open source project, some aspects of the development process may seem unusual, arcane, or some combination of both.
Before working on this issue and opening a pull request, please read the project's contributing guidelines. These guidelines and the associated development guide provide important information, including links to stdlib's Code of Conduct, license policy, and steps for setting up your local development environment. To reiterate, we strongly encourage you to refer to our contributing guides before beginning work on this issue. Failure to follow our guidelines significantly decreases the likelihood that you'll successfully contribute to stdlib and may result in automatic closure of a pull request without review. Setting up your local development environment is a critical first step, as doing so ensures that automated development processes for linting, license verification, and unit testing can run prior to authoring commits and pushing changes. If you would prefer to avoid manual setup, we provide pre-configured development containers for use locally or in GitHub Codespaces. We place a high value on consistency throughout the stdlib codebase. We encourage you to closely examine other packages in stdlib and attempt to emulate the practices and conventions found therein.
In short, the more effort you put in to ensure that your contribution looks and feels like stdlib—including variables names, bracket spacing, line breaks, etc—the more likely that your contribution will be reviewed and ultimately accepted. We encourage you to closely study the codebase before beginning work on this issue. ✨ Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions. ✨ |
👋 Hi there! 👋 And thank you for opening your first issue! We will get back to you shortly. 🏃 💨 |
hello @kgryte, a test for - " if provided |
Hi @kgryte, for now i removed that last test for checking NaN values for W invocations, seemed unnecessay as we are just skipping NaN, if you would like, i could add some other test, but i felt all tests works as checks most of the testcases possible. |
Description
This RFC proposes adding a new package to the
stats/incr/*
namespace:@stdlib/stats/incr/nanmhmean
.This package is similar to
@stdlib/stats/incr/mhmean
, except that it performs special handling ofNaN
values.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/mhmean
(propagatesNaN
values) and@stdlib/stats/incr/nansum
(wraps aNaN
propagating accumulator and skipsNaN
values).In particular notice how
nansum
is 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/mhmean
. We expect this package to have equivalent and fully comprehensive tests. The primary difference will be in the handling ofNaN
values.To see an example of what is expected, study the tests in
@stdlib/stats/incr/sum
and@stdlib/stats/incr/nansum
Compare 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/nanmhmean/.*"
To run benchmarks,
make benchmark BENCHMARKS_FILTER=".*/stats/incr/nanmhmean/.*"
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]:
.The text was updated successfully, but these errors were encountered: