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

add chunk_ranges function to iterutils #312

Merged
merged 1 commit into from
Feb 20, 2023

Conversation

jstriebel
Copy link
Contributor

This PR adds a chunk_ranges function to iterutils, which doesn't chunk an iterable or list directly, but produces the relevant indices to chunk it. It contains functionality for windowing/overlap (see also issue #310) and alignment of the chunks. I'm not sure if input_size or input_end is more appropriate for the arguments, also the function name might need improvement.

It would be great to incorporate this function into boltons IMO, thanks a lot for considering this.

This PR includes the function itself, a test, and updates the docs.

@jstriebel
Copy link
Contributor Author

@mahmoud Friendly ping :-) What do you think about adding those changes?

Copy link
Owner

@mahmoud mahmoud left a comment

Choose a reason for hiding this comment

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

Hey thanks for your patience (#newdadlife over here), and thanks for the PR!

From what I see:

So let's go for it :)

@mahmoud mahmoud merged commit 243de3f into mahmoud:master Feb 20, 2023
@jstriebel jstriebel deleted the iterutils-indices branch February 20, 2023 10:36
@jstriebel
Copy link
Contributor Author

Thank you for maintaining this lib, @mahmoud!

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.

2 participants