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 ability to include smaller last batch #632

Merged
merged 4 commits into from
Mar 29, 2023

Conversation

nkoppel
Copy link
Contributor

@nkoppel nkoppel commented Mar 29, 2023

This is a breaking change that changes the name of batch to batch_exact, and redefines batch to include the smaller last batch if it exists. As documented, the last batch will always contain at least one element.

@coreylowman
Copy link
Owner

Thoughts on making this non breaking in the following way:

  1. Keep existing batch method, but add #[deprecated] mentioning the new batch_exact
  2. Add batch_exact like you do so here
  3. Add batch_with_last (what you have here in the PR as batch). Alternative names might be batch_uneven, batch_unexact, batch_keep_last

I'd like to start moving towards using deprecation more and this could be a good place to try it out.

@nkoppel
Copy link
Contributor Author

nkoppel commented Mar 29, 2023

These changes should now be completely non-breaking.

Copy link
Owner

@coreylowman coreylowman left a comment

Choose a reason for hiding this comment

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

Nice changes! 👍

@coreylowman coreylowman merged commit fa60e0c into coreylowman:main Mar 29, 2023
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