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

[skip CI] [do not merge] Add 'cycle' operator #5484

Closed
wants to merge 1 commit into from

Conversation

adamrtalbot
Copy link
Collaborator

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 to
the contribution commit message. For more details check [3].

  1. https://developercertificate.org/
  2. https://github.com/nextflow-io/nextflow/blob/master/COPYING
  3. https://github.com/apps/dco

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]>
@adamrtalbot adamrtalbot requested a review from a team as a code owner November 8, 2024 10:40
Copy link

netlify bot commented Nov 8, 2024

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit 48757fd
🔍 Latest deploy log https://app.netlify.com/sites/nextflow-docs-staging/deploys/672deabb802e0d0008b683e9
😎 Deploy Preview https://deploy-preview-5484--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@adamrtalbot adamrtalbot changed the title Add 'cycle' operator [skip CI] [do not merge] Add 'cycle' operator Nov 8, 2024
/**
* Implements the cycle operator that pairs channel items with cycling indices
*
* @author [Your Name]
Copy link
Member

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]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @author [Your Name]
* @author Adam Talbot

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or should I say

Suggested change
* @author [Your Name]
* @author claude-3.5-sonnet

@bentsherman bentsherman marked this pull request as draft November 8, 2024 22:06
@bentsherman
Copy link
Member

bentsherman commented Nov 13, 2024

Based on discussion with Adam, closing in favor of writing a cycle function in your pipeline code. Something like:

def cycle(vals, range) {
  vals.withIndex().collect { i, v -> [ range[i % range.size()], v ] }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants