Skip to content

Commit 137d15d

Browse files
authored
Quantum espresso mapping parser (#10)
* Revisions from review * Add initial fhiaims parser * Initial workflow parser classes * Refactor * Use workflow defs * Parse workflow * Parse workflow * Add phononpy * Initial quantum espresso parser * Linting fix * Refactor exciting schema * Linting fix * Remove unnecessary change * Fix commit * Fix structlog error * Add qe tests
1 parent bb67e30 commit 137d15d

File tree

33 files changed

+41304
-138
lines changed

33 files changed

+41304
-138
lines changed

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ fhiaims_parser_entry_point = "nomad_simulation_parsers.parsers:fhiaims_parser_en
130130
fhiaims_schema_package_entry_point = "nomad_simulation_parsers.schema_packages:fhiaims_schema_package_entry_point"
131131
phonopy_parser_entry_point = "nomad_simulation_parsers.parsers:phonopy_parser_entry_point"
132132
phonopy_schema_package_entry_point = "nomad_simulation_parsers.schema_packages:phonopy_schema_package_entry_point"
133+
quantumespresso_parser_entry_point = "nomad_simulation_parsers.parsers:quantumespresso_parser_entry_point"
134+
quantumespresso_schema_package_entry_point = "nomad_simulation_parsers.schema_packages:quantumespresso_schema_package_entry_point"
133135
vasp_parser_entry_point = "nomad_simulation_parsers.parsers:vasp_parser_entry_point"
134136
vasp_schema_package_entry_point = "nomad_simulation_parsers.schema_packages:vasp_schema_package_entry_point"
135137
wannier90_parser_entry_point = "nomad_simulation_parsers.parsers:wannier90_parser_entry_point"

src/nomad_simulation_parsers/parsers/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,21 @@ class Wannier90ParserEntryPoint(EntryPoint):
6969
code_homepage='https://phonopy.github.io/phonopy/',
7070
)
7171

72+
quantumespresso_parser_entry_point = EntryPoint(
73+
name='parsers/quantumespresso',
74+
aliases=['parsers/quantumespresso'],
75+
description='NOMAD parser for QUANTUMESPRESSO.',
76+
python_package='nomad_simulation_parsers',
77+
mainfile_contents_re=(
78+
r'(Program [A-Z]+.*starts)|(Current dimensions of program [A-Z]+ are)'
79+
),
80+
supported_compressions=['gz', 'bz2', 'xz'],
81+
parser_class_name='nomad_simulation_parsers.parsers.quantumespresso.parser.QuantumEspressoParser',
82+
code_name='QuantumESPRESSO',
83+
code_homepage='http://www.quantum-espresso.org/',
84+
code_category='Atomistic code',
85+
)
86+
7287
vasp_parser_entry_point = EntryPoint(
7388
name='parsers/vasp',
7489
description='Parser for VASP XML and OUTCAR outputs',

src/nomad_simulation_parsers/parsers/exciting/parser.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def write_to_archive(self) -> None:
193193

194194
# read xc functionals from input.xml
195195
input_xml_files = (
196-
search_files('input.xml', maindir, mainbase)
196+
search_files('input.xml', maindir, re_pattern=mainbase)
197197
if not self.archive.m_xpath('data.model_method[0].xc_functionals')
198198
else []
199199
)
@@ -204,7 +204,7 @@ def write_to_archive(self) -> None:
204204
input_xml_parser.close()
205205

206206
# eigenvalues from eigval.out
207-
eigval_files = search_files('EIGVAL.OUT', maindir, mainbase)
207+
eigval_files = search_files('EIGVAL.OUT', maindir, re_pattern=mainbase)
208208
if eigval_files:
209209
eigval_parser = EigvalParser(
210210
filepath=eigval_files[0], text_parser=EigvalFileParser()
@@ -214,7 +214,9 @@ def write_to_archive(self) -> None:
214214
eigval_parser.close()
215215

216216
# bandstructure from bandstructure.xml
217-
bandstructure_files = search_files('bandstructure.xml', maindir, mainbase)
217+
bandstructure_files = search_files(
218+
'bandstructure.xml', maindir, re_pattern=mainbase
219+
)
218220
if bandstructure_files:
219221
bandstructure_parser = BandstructureXMLParser(
220222
filepath=bandstructure_files[0]
@@ -225,7 +227,7 @@ def write_to_archive(self) -> None:
225227
bandstructure_parser.close()
226228

227229
# dos from dos.xml
228-
dos_files = search_files('dos.xml', maindir, mainbase)
230+
dos_files = search_files('dos.xml', maindir, re_pattern=mainbase)
229231
if dos_files:
230232
dos_parser = DosXMLParser(filepath=dos_files[0])
231233
data_parser.annotation_key = 'dos_xml'

0 commit comments

Comments
 (0)