-
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
[skip CI] [do not merge] Add 'cycle' operator #5484
Conversation
This is a simple operator that loops over an range and applies it as an index to each channel. I don't intend this to be merged, it's a little demo to remind myself how it works Signed-off-by: adamrtalbot <[email protected]>
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
/** | ||
* Implements the cycle operator that pairs channel items with cycling indices | ||
* | ||
* @author [Your Name] |
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.
don't by shy 😄
/** | ||
* Implements the cycle operator that pairs channel items with cycling indices | ||
* | ||
* @author [Your Name] |
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.
* @author [Your Name] | |
* @author Adam Talbot |
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.
Or should I say
* @author [Your Name] | |
* @author claude-3.5-sonnet |
Based on discussion with Adam, closing in favor of writing a def cycle(vals, range) {
vals.withIndex().collect { i, v -> [ range[i % range.size()], v ] }
} |
This is a simple operator that loops over an range and applies it as an index to each channel.
I don't intend this to be merged, it's a little demo to remind myself how it works
Signed-off-by: adamrtalbot [email protected]
Hi! Thanks for contributing to Nextflow project.
When submitting a Pull Request please make sure to not include
in the changeset any modification in these files:
nextflow
modules/nf-commons/src/main/nextflow/Const.groovy
Also, please sign-off the DCO [1] to certify you are the author of the contribution
and you adhere to Nextflow open source license [2] adding a
Signed-off-by
line tothe contribution commit message. For more details check [3].