-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
98 lines (90 loc) · 3.15 KB
/
Copy pathutils.py
File metadata and controls
98 lines (90 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
from __future__ import annotations
from typing import List, Dict
from pathlib import Path
import argparse
def get_seed() -> int:
'''
Return: int
A common seed.
'''
return 2147483647
def get_paths() -> Dict:
'''
Return: Dict {key: Path}
Project specific paths.
'''
io_dir = Path(__file__).parent/'io_'
return {'io': io_dir,
'original': io_dir/'data',
'compatible': io_dir/'compatible',
'model': io_dir/'model',
'deploy': io_dir/'deploy',
'post': io_dir/'post',
'eda': io_dir/'eda',
'chtc': io_dir.parent/'chtc'}
def get_cli_args() -> Dict:
'''
CLI argument parser.
Return: Dict
Dictionary of CLI args.
'''
parser = argparse.ArgumentParser('Trait modeling.')
parser.add_argument('--pattern',
action='store',
type=str,
default='*')
parser.add_argument('--n_min_samples',
action='store',
type=int,
default=30)
parser.add_argument('--n_outers',
action='store',
default=200,
type=int)
parser.add_argument('--n_inners',
action='store',
default=30,
type=int)
parser.add_argument('--outer_type',
action='store',
default='montecarlo')
parser.add_argument('--inner_type',
action='store',
default='montecarlo')
parser.add_argument('--test_percent',
action='store',
default=15,
type=int)
parser.add_argument('--valid_percent',
action='store',
default=15,
type=int)
parser.add_argument('--n_components',
action='store',
default=40,
type=int)
parser.add_argument('--query',
action='store_true',
default=False)
##
parser.add_argument('--chtc_n_models_per_submit',
action='store',
type=int,
default=-1)
parser.add_argument('--chtc_user',
action='store',
type=str,
default='pravindran')
parser.add_argument('--chtc_project_name',
action='store',
type=str,
default='ana-kilgore')
parser.add_argument('--chtc_models_list',
action='store',
type=str,
default='')
args = parser.parse_args().__dict__
args['n_repeats'] = (args['n_outers'], args['n_inners'])
args['split_types'] = (args['outer_type'], args['inner_type'])
args['split_percents'] = (args['test_percent'], args['valid_percent'])
return args