|
4 | 4 |
|
5 | 5 | import argparse
|
6 | 6 |
|
7 |
| -partitioning_strategies = ['windows', 'undefine1', 'undefined2'] # to be completed ????????????? |
| 7 | +partitioning_strategies = [ |
| 8 | + "windows", |
| 9 | + "undefine1", |
| 10 | + "undefined2", |
| 11 | +] # to be completed ????????????? |
8 | 12 |
|
9 | 13 |
|
10 | 14 | def parse_arguments():
|
11 |
| - parser = argparse.ArgumentParser( |
12 |
| - description='feature-set partioning' |
13 |
| - ) |
| 15 | + parser = argparse.ArgumentParser(description="feature-set partioning") |
14 | 16 |
|
15 |
| - parser.add_argument('--in_dir', |
16 |
| - type=str, |
17 |
| - help='Directory containing feature-set list files') |
| 17 | + parser.add_argument( |
| 18 | + "--in_dir", type=str, help="Directory containing feature-set list files" |
| 19 | + ) |
18 | 20 |
|
19 |
| - parser.add_argument('--out_dir', |
20 |
| - default='results', |
21 |
| - type=str, |
22 |
| - help='Directory to contain generated plan files') |
| 21 | + parser.add_argument( |
| 22 | + "--out_dir", |
| 23 | + default="results", |
| 24 | + type=str, |
| 25 | + help="Directory to contain generated plan files", |
| 26 | + ) |
23 | 27 |
|
24 |
| - parser.add_argument('--json', |
25 |
| - action='store_true', |
26 |
| - help='Generate plan in JSON format') |
| 28 | + parser.add_argument( |
| 29 | + "--json", action="store_true", help="Generate plan in JSON format" |
| 30 | + ) |
27 | 31 |
|
28 |
| - parser.add_argument('--overwrite', |
29 |
| - action='store_true', |
30 |
| - help='Accept non-empty out_dir, contents overwritten') |
| 32 | + parser.add_argument( |
| 33 | + "--overwrite", |
| 34 | + action="store_true", |
| 35 | + help="Accept non-empty out_dir, contents overwritten", |
| 36 | + ) |
31 | 37 |
|
32 |
| - parser.add_argument('--partition_strategy', |
33 |
| - choices=partitioning_strategies, |
34 |
| - default=partitioning_strategies[0], |
35 |
| - help='Specify a feature-set partitioning strategy') |
| 38 | + parser.add_argument( |
| 39 | + "--partition_strategy", |
| 40 | + choices=partitioning_strategies, |
| 41 | + default=partitioning_strategies[0], |
| 42 | + help="Specify a feature-set partitioning strategy", |
| 43 | + ) |
36 | 44 |
|
37 | 45 | # The following fs_* arguments are required, the number of values specified for each
|
38 | 46 | # must match, and at least two values are required for each
|
39 | 47 |
|
40 |
| - parser.add_argument('--fs_names', |
41 |
| - required=True, |
42 |
| - type=str, |
43 |
| - nargs='+', |
44 |
| - help='Specify a list of (arbitrary) feature-set names') |
45 |
| - |
46 |
| - parser.add_argument('--fs_paths', |
47 |
| - required=True, |
48 |
| - type=str, |
49 |
| - nargs='+', |
50 |
| - help='Specify a list of feature-set file paths') |
51 |
| - |
52 |
| - parser.add_argument('--fs_parts', |
53 |
| - required=True, |
54 |
| - type=int, |
55 |
| - nargs='+', |
56 |
| - help='Specify a list of partition counts') |
57 |
| - |
58 |
| - parser.add_argument('--verbose', |
59 |
| - action='store_true', |
60 |
| - help='Verbosity') |
61 |
| - |
62 |
| - parser.add_argument('--debug', |
63 |
| - action='store_true', |
64 |
| - help='Data structure dumps, etc') |
65 |
| - |
66 |
| - parser.add_argument('--test', |
67 |
| - action='store_true', |
68 |
| - help='Test plan navigation and entry retrieval') |
69 |
| - |
70 |
| - parser.add_argument('--maxdepth', type=int, default=0) |
71 |
| - parser.add_argument('--print_tree', action='store_true') |
| 48 | + parser.add_argument( |
| 49 | + "--fs_names", |
| 50 | + required=True, |
| 51 | + type=str, |
| 52 | + nargs="+", |
| 53 | + help="Specify a list of (arbitrary) feature-set names", |
| 54 | + ) |
| 55 | + |
| 56 | + parser.add_argument( |
| 57 | + "--fs_paths", |
| 58 | + required=True, |
| 59 | + type=str, |
| 60 | + nargs="+", |
| 61 | + help="Specify a list of feature-set file paths", |
| 62 | + ) |
| 63 | + |
| 64 | + parser.add_argument( |
| 65 | + "--fs_parts", |
| 66 | + required=True, |
| 67 | + type=int, |
| 68 | + nargs="+", |
| 69 | + help="Specify a list of partition counts", |
| 70 | + ) |
| 71 | + |
| 72 | + parser.add_argument("--verbose", action="store_true", help="Verbosity") |
| 73 | + |
| 74 | + parser.add_argument( |
| 75 | + "--debug", action="store_true", help="Data structure dumps, etc" |
| 76 | + ) |
| 77 | + |
| 78 | + parser.add_argument( |
| 79 | + "--test", action="store_true", help="Test plan navigation and entry retrieval" |
| 80 | + ) |
| 81 | + |
| 82 | + parser.add_argument("--maxdepth", type=int, default=0) |
| 83 | + parser.add_argument("--print_tree", action="store_true") |
72 | 84 | args = parser.parse_args()
|
73 | 85 | return args
|
0 commit comments