Description
Description
This RFC proposes adding a new package to the stats/incr/*
namespace: @stdlib/stats/incr/nanmvmr
.
This package is similar to @stdlib/stats/incr/mvmr
, except that it performs special handling of NaN
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/mvmr
(propagates NaN
values) and @stdlib/stats/incr/nansum
(wraps a NaN
propagating accumulator and skips NaN
values).
In particular notice how nansum
is a thin wrapper around sum
. 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/mvmr
. We expect this package to have equivalent and fully comprehensive tests. The primary difference will be in the handling of NaN
values.
To see an example of what is expected, study the tests in
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,
make test TESTS_FILTER=".*/stats/incr/nanmvmr/.*"
To run examples,
make examples EXAMPLES_FILTER=".*/stats/incr/nanmvmr/.*"
To run benchmarks,
make benchmark BENCHMARKS_FILTER=".*/stats/incr/nanmvmr/.*"
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
- If you are interested in contributing a PR which addresses this RFC and still getting familiar with our project conventions, please do not submit LLM-generated code. Please consult our contributing guidelines and the associated development guide. Failure to respect project conventions will result in your PR being rejected without review. Thank you for understanding!
Checklist
- I have read and understood the Code of Conduct.Searched for existing issues and pull requests.The issue name begins with
[RFC]:
.
Activity
stdlib-bot commentedon Mar 1, 2025
👋 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. ✨
NaN
values instats/incr/*
(tracking issue) #5966gkbishnoi07 commentedon Mar 18, 2025
@kgryte working on it!
stats/incr/nanmvmr
#6293