stdlib-js / stdlib

✨ Standard library for JavaScript and Node.js. ✨
https://stdlib.io
Apache License 2.0
4.15k stars 403 forks source link

[RFC]: improve README examples of `stats/iter` namespace #1652

Open Planeshifter opened 4 months ago

Planeshifter commented 4 months ago

Description

This RFC proposes to improve the README examples of the stats/iter namespace package. Currently, namespace package READMEs only include minimal examples which are not particularly informative and do not showcase namespace functionality.

Historically, namespace examples were not given much effort due to the rapidly changing nature of the project; however, now that development and organization has settled, it would be good to revisit these packages and add proper examples to better communicate to users how to use namespace contents.

For those wanting to contribute to this issue, you can use the following steps:

Related Issues

None.

Questions

No.

Other

No.

Checklist

pankaj-2503 commented 4 months ago

Hey @Planeshifter there are already average of about 60-70 examples do you want to increase the examples or you want some interesting examples to showcase .

Planeshifter commented 4 months ago

@pankaj-2503

Specifically, this PR is about changing the namespace example code block, which currently looks like this:

var getKeys = require( '@stdlib/utils/keys' );
var ns = require( '@stdlib/stats/iter' );

console.log( getKeys( ns ) );

Instead, it would be good to show a few functions and how they are used. It's better here to be selective, for example we could show one example with for a regular iterator and then also one using an iterator that computes a moving statistic, i.e. one supporting a window (W) parameter. Would be good to not just reuse examples from the individual packages, but for example come up with one conceptual example that involves multiple packages.

Hope this makes sense. Please let me know if you would like to give this a shot!

pankaj-2503 commented 4 months ago

Yeah i would like to contribute to this readme files . Also can you show an example for the same, i just landed on this repo

Megh2005 commented 3 months ago

I would like to contribute to this read me files . Also can you show an example for the same, i just landed on this repo