stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

docs: improve examples of `ndarray/iter` namespace

Open performant23 opened this issue 1 year ago • 2 comments

Updated examples to span over the functionalities implemented in the namespace.

Resolves #1589

Description

What is the purpose of this pull request?

Provide better examples for the namespace to demonstrate its capabilities and usage.

This pull request:

  • Imports different functionalities inside ndarray/iter to form useful usecases

Related Issues

Does this pull request have any related issues?

This pull request:

  • resolves #1589

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

performant23 avatar Mar 04 '24 08:03 performant23

Hello, thought I should just push a draft PR for one namespace and receive feedback before moving to another in the package in ndarray! Also, I have these questions:

  1. Do we include the outputs of the examples as comments for README.md?
  2. Do we need to format the output in some particular way? That is, in the second example, the log is like: Index: [ 0, 0 ] Value: 1, and for the last one, we print the initial type of the object like: Original ndarray: ndarray( 'generic', [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ], [ 3, 3 ], [ 3, 1 ], 0, 'row-major' ). So, is that necessary or we should just always log the final output?

Thank you so much!!

performant23 avatar Mar 04 '24 08:03 performant23

Thank you so much for the review, @kgryte! I have modified the commit to include an example which uses functionalities from other packages! Please do let me know if there are any further changes necessary.

Also, I found that packages followed the convention of including comments below code. Since I was getting the below message, I left a line between the code and the necessary comments. Please do let me know in case we need to include corresponding comments above the code.

Missing empty line before comment  stdlib/empty-line-before-comment

performant23 avatar Mar 04 '24 17:03 performant23

/stdlib merge

kgryte avatar Nov 25 '24 06:11 kgryte

Coverage Report

Package Statements Branches Functions Lines
ndarray/iter $\color{green}168/168$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}0/0$
$\color{green}+100.00\%$
$\color{green}168/168$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this PR.

stdlib-bot avatar Nov 25 '24 06:11 stdlib-bot