-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from clingen-data-model/multiprocess-and-timeouts
Multiprocessing and timeouts
- Loading branch information
Showing
6 changed files
with
333 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import argparse | ||
from typing import List | ||
|
||
|
||
def parse_args(args: List[str]) -> dict: | ||
""" | ||
Parse arguments and return as dict. | ||
""" | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--filename", required=True, help="Filename to read") | ||
parser.add_argument( | ||
"--parallelism", | ||
type=int, | ||
default=1, | ||
help=( | ||
"Number of worker threads. " | ||
"Default 1, which still uses a separate process to run tasks. " | ||
"Set to 0 to run in main thread." | ||
), | ||
) | ||
return vars(parser.parse_args(args)) |
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
Oops, something went wrong.