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

Insufficient test coverage of batched_parmap #104

Open
atapin opened this issue Jul 4, 2024 · 0 comments · May be fixed by #105
Open

Insufficient test coverage of batched_parmap #104

atapin opened this issue Jul 4, 2024 · 0 comments · May be fixed by #105

Comments

@atapin
Copy link

atapin commented Jul 4, 2024

Line 47 is supposed to check if trailing chunks of batches are processed, but it lacks for proper coverage.

def batched_parmap(fn: Callable, args: list, batch_size: int = 10) -> list: # type: ignore[type-arg] # noqa: E501
results = []
i, j = 0, 0
while i < len(args):
i, j = i + batch_size, i
if len(args) > i:
batch = args[j:i]
else:
batch = args[j:]
res = parmap(fn, batch)
results += res
return results

@atapin atapin linked a pull request Jul 4, 2024 that will close this issue
6 tasks
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 a pull request may close this issue.

1 participant