Skip to content

Commit

Permalink
first template
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Daelman committed Nov 19, 2024
1 parent 84fed5d commit 9f733a2
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions electronicparsers/boss/parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
class ABACUSInputParser(TextParser):
def __init__(self):
super().__init__(None)

re_float = '\d\.\d+e\+\d{2}'
self._quantities = [
Quantity(
'row',
rf'\s+({re_float}\s+{re_float}\s+{re_float}\s+{re_float})\n',
repeats=True,
dtype=np.float64,
sub_parser=TextParser(
quantities=[
Quantity(
'var_1',
r'\n *stru_file\s*(\S+)',
),
Quantity(
'var_2',
r'\n *kpoint_file\s*(\S+)',
),
Quantity(
'gp_mean',
r'\n *basis_type\s*(\w+)',
),
Quantity(
'gp_variance',
r'\n *init_vel\s*(\d+)',
dtype=bool,
),
]
),
),
]

0 comments on commit 9f733a2

Please sign in to comment.