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

Added test coverage for batched_parmap #105

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

atapin
Copy link

@atapin atapin commented Jul 4, 2024

Description

Added test coverage for batched_parmap function and improved its readability by simplifying the implementation. Also improved the performance by utilizing list.extend method instead of + concatenation. Extension modifies a list in place, instead of creating a new list by +

Motivation and Context

Currently batched_parmap has unnecessary cyclomatic complexity, because it has to check for trailing chunks of batches in case when size of args is not divisible by batch_size. Even though the check is implemented, this case is not covered by tests.
Also, memory consumption of this function can be reduced by replacing list concatenation with list extension.

Fixes #104

How has this been tested?

I provided a unit test and ran all other tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

…ability by simplifying the implementation. Also improved the performance by utilizing list.extend method instead of `+` concatenation. Extension modifies a list in place, instead of creating a new list by `+`
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.

Insufficient test coverage of batched_parmap
1 participant