Skip to content

Insufficient test coverage of batched_parmap #104

Description

@atapin

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions