-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.py
More file actions
39 lines (34 loc) · 1.33 KB
/
Copy pathparser.py
File metadata and controls
39 lines (34 loc) · 1.33 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
class Parser:
def __init__(self, argparse):
self.parser = argparse.ArgumentParser(
description='Calculate encut optimization')
self.add_arguments()
self.add_options()
def add_arguments(self):
self.parser.add_argument('action',
choices=('encut', 'lattice_constant',
'kpoint'))
self.parser.add_argument(
'min_value', help='minimum value of optimization parameter')
self.parser.add_argument('max_value',
help='maximum optimization parameter')
self.parser.add_argument(
'step', help='step of variation between minimum and maximum')
def add_options(self):
self.parser.add_argument(
'-np',
'--number_cores',
default=1,
help='plot the optimization graph - Optional argument')
self.parser.add_argument(
'-g',
'--graph',
action='store_true',
help='plot the optimization graph - Optional argument')
self.parser.add_argument(
'-td',
'--two_dimensions',
action='store_true',
help='Adjust kpoints to two dimentional materials')
def parse_args(self):
return self.parser.parse_args()