Skip to content
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

[RFC]: add @stdlib/iter/cartesian-product #1335

Open
3 tasks done
kgryte opened this issue Feb 21, 2024 · 5 comments
Open
3 tasks done

[RFC]: add @stdlib/iter/cartesian-product #1335

kgryte opened this issue Feb 21, 2024 · 5 comments
Assignees
Labels
Accepted RFC feature request which has been accepted. difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. Feature Issue or pull request for adding a new feature. Good First Issue A good first issue for new contributors! JavaScript Issue involves or relates to JavaScript. priority: Low Low priority concern or feature request. RFC Request for comments. Feature requests and proposed changes. Utilities Issue or pull request concerning general utilities.

Comments

@kgryte
Copy link
Member

kgryte commented Feb 21, 2024

Description

This RFC proposes adding the package @stdlib/iter/cartesian-product.

This package would be the iterator equivalent of @stdlib/array/cartesian-product.

function iterCartesianProduct( x1, x2 ) { ... }

where x1 and x2 are input array-like objects.

Package: @stdlib/iter/cartesian-product
Alias: iterCartesianProduct

Related Issues

None.

Questions

No.

Other

No.

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.
@kgryte kgryte added RFC Request for comments. Feature requests and proposed changes. Feature Issue or pull request for adding a new feature. Good First Issue A good first issue for new contributors! labels Feb 21, 2024
@Aryann15
Copy link

Hello! I'd like to work on this issue, Please assign it to me.
Thank you.

@kgryte
Copy link
Member Author

kgryte commented Feb 22, 2024

Thanks for volunteering to work on this issue @Aryann15. Please feel free to submit a PR implementing this feature.

@Aryann15
Copy link

I wanted to seek clarification regarding the process of adding the @stdlib/iter/cartesian-product package to our project,

Based on my understanding of the issue description, the goal is to incorporate the iterator equivalent of @stdlib/array/cartesian-product into our project. Specifically, we aim to introduce the iterCartesianProduct(x1, x2) function, which generates an iterator over the Cartesian product of two input array-like objects, x1 and x2.

To accomplish this task, I've outlined the steps I plan to take:

I intend to install the @stdlib/iter/cartesian-product package using npm or yarn. I will run the following command in our project directory:
npm install @stdlib/iter/cartesian-product

After installing the package, I will import it into the relevant file or module where we plan to utilize the iterCartesianProduct function.
const iterCartesianProduct = require('@stdlib/iter/cartesian-product');

With the package imported, I will proceed to use the iterCartesianProduct function in our codebase. I will provide appropriate array-like objects (x1 and x2) as input to generate iterators over their Cartesian product.

Example:
const x1 = [1, 2, 3];
const x2 = ['a', 'b', 'c'];
const iterator = iterCartesianProduct(x1, x2);
for (const product of iterator) {
console.log(product);
}

I would greatly appreciate your feedback on whether this approach aligns with our project requirements and if any adjustments or additional considerations are necessary.
Thank you!

@kgryte
Copy link
Member Author

kgryte commented Feb 22, 2024

@Aryann15 The approach you outline is not correct. See https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/iter for example iterator packages. You should only develop against the main project repository. There is no need to install standalone packages as you mention in your comment.

@kgryte kgryte added priority: Low Low priority concern or feature request. Utilities Issue or pull request concerning general utilities. JavaScript Issue involves or relates to JavaScript. difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. Accepted RFC feature request which has been accepted. labels Feb 23, 2024
@shubhexists
Copy link
Contributor

Hi Aryan, Are you currently proceeding with the issue? If not, I would like to give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted RFC feature request which has been accepted. difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. Feature Issue or pull request for adding a new feature. Good First Issue A good first issue for new contributors! JavaScript Issue involves or relates to JavaScript. priority: Low Low priority concern or feature request. RFC Request for comments. Feature requests and proposed changes. Utilities Issue or pull request concerning general utilities.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants