Skip to content

Conversation

@medecau
Copy link
Contributor

@medecau medecau commented Dec 9, 2018

This pull-request refactors parallel.fold to make it work with multiprocessing.Pool.map()

I ran into a few problems while writing code for this. Lambdas cannot be used and reduce() cannot be partially applied with keyword arguments.

medecau added 6 commits July 3, 2019 20:34
fold cannot use lambdas if using multiprocessing.Pool().map()
chunksize should not be less than 2
Previously I planned to force chunksize value to be larger than 2 and wrote a test to allow chunksize equal to two.
Fold takes a combination function which I am not sure how to interpret and prefer not to mess with so if the user choses a chunksize of 1 than we raise an exception instead of trapping ourselves in an infinite loop.
@eriknw
Copy link
Member

eriknw commented Jul 9, 2019

LGTM. Thanks @medecau! Sorry for the delay.

@eriknw eriknw merged commit 0434ddd into pytoolz:master Jul 9, 2019
@medecau
Copy link
Contributor Author

medecau commented Jul 9, 2019

🙏 Thank you for taking the time to review this.

Really happy 😁 to be able to contribute to toolz.

@medecau medecau deleted the multiprocessing-fold branch July 9, 2019 20:58
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