-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for the first finished parallel proccess (#1546)
* Check for the first finished parallel proccess This fixes #1316 to optimize the parallel map runs by checking for the first finished process instead of waiting for the first process before checking others. * Fix code format with black * Reduce wait to 0.1 seconds
- Loading branch information
Showing
2 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from metaflow.multicore_utils import parallel_map | ||
|
||
|
||
def test_parallel_map(): | ||
assert parallel_map(lambda s: s.upper(), ["a", "b", "c", "d", "e", "f"]) == [ | ||
"A", | ||
"B", | ||
"C", | ||
"D", | ||
"E", | ||
"F", | ||
] |