stdlib-js / stdlib-js/stdlib

[RFC]: add `stats/incr/nanmmeanabs2`

Đang mở
#5,590 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Accepted difficulty: 2 Feature Good First Issue JavaScript priority: Normal RFC Statistics
Ngôn ngữ chính
JavaScript
Star
6k
Fork
1.3k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
611

Mô tả

## Description

This RFC proposes adding a new package to the `stats/incr/*` namespace: `@stdlib/stats/incr/nanmmeanabs2`.

This package is similar to [`@stdlib/stats/incr/mmeanabs2`](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/incr/mmeanabs2), 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/mmeanabs2`](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/incr/mmeanabs2) (propagates `NaN` values) and [`@stdlib/stats/incr/nansum`](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/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/mmeanabs2`](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/incr/mmeanabs2). 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

- [`@stdlib/stats/incr/sum`](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/incr/sum) and [`@stdlib/stats/incr/nansum`](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/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,

```bash
make test TESTS_FILTER=".*/stats/incr/nanmmeanabs2/.*"
```

To run examples,

```bash
make examples EXAMPLES_FILTER=".*/stats/incr/nanmmeanabs2/.*"
```

To run benchmarks,

```bash
make benchmark BENCHMARKS_FILTER=".*/stats/incr/nanmmeanabs2/.*"
```

### 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](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) and the associated [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md). Failure to respect project conventions will result in your PR being rejected without review. Thank you for understanding!

### Checklist

- [X] I have read and understood the [Code of Conduct](https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md).
- [X] Searched for existing issues and pull requests.
- [X] The issue name begins with `[RFC]:`.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start by comparing lib/node_modules/@stdlib/stats/incr/mmeanabs2 and lib/node_modules/@stdlib/stats/incr/nansum, especially their tests, documentation, examples, and package structure. Read CONTRIBUTING.md and docs/development.md before deciding the API and NaN behavior. Done means the new package has comprehensive tests, documentation, examples, and benchmarks, and the listed make commands pass.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
data
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.