-
-
Notifications
You must be signed in to change notification settings - Fork 629
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
docs: improve examples of ndarray/iter
namespace
#1686
base: develop
Are you sure you want to change the base?
docs: improve examples of ndarray/iter
namespace
#1686
Conversation
Updated examples to span over the functionalities implemented in the namespace. Addresses: stdlib-js#1589
Hello, thought I should just push a draft PR for one namespace and receive feedback before moving to another in the package in ndarray!
Thank you so much!! |
Update the copyright year Signed-off-by: Rutam <[email protected]>
// Example: Get an array consisting of keys/properties inside ns. | ||
var objectKeys = require( '@stdlib/utils/keys' ); | ||
var ns = require( '@stdlib/ndarray/iter' ); | ||
|
||
console.log( objectKeys( ns ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer modifying the existing example code. Project conventions are to not create multiple separate Markdown code blocks. Prefer instead a single Markdown code block with various example usage.
var iterEntries = ns.nditerEntries( x ); | ||
var entry; | ||
|
||
for ( entry of iterEntries ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ES5.
``` | ||
|
||
```javascript | ||
// Example: Iterate over each row of the ndarray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These examples seem to just be pulling from the READMEs of the child packages. I think we would prefer something fresh, which ideally combines the functionality of multiple packages to demonstrate how they can all work together.
ndarray/iter
namespace
Updated example for the namespace using functionalities from stats, random, and ndarray Fixes: stdlib-js#1589
…ndarray/iter_namespace' into docs/improve_README_examples_of_ndarray/iter_namespace
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.
|
…_ndarray/iter_namespace
ndarray/iter
namespacendarray/iter
namespace
/stdlib merge |
…DME_examples_of_ndarray/iter_namespace
Coverage Report
The above coverage report was generated for the changes in this PR. |
Updated examples to span over the functionalities implemented in the namespace.
Resolves #1589
Description
Provide better examples for the namespace to demonstrate its capabilities and usage.
This pull request:
Related Issues
This pull request:
ndarray/iter
namespace #1589Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers