Skip to content

Commit 200377d

Browse files
committed
Run old parsers
1 parent d89a771 commit 200377d

File tree

9 files changed

+72
-0
lines changed

9 files changed

+72
-0
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ dependencies = [
3737
"python-magic-bin; sys_platform == 'win32'",
3838
"phonopy>=2.35",
3939
"nomad-parser-plugins-electronic @ git+https://github.com/nomad-coe/electronic-parsers.git@unlink-parsers",
40+
"nomad-parser-plugins-workflow @ git+https://github.com/nomad-coe/workflow-parsers.git@unlink-parsers",
4041
]
4142

4243
[project.urls]

src/nomad_simulation_parsers/parsers/abinit/parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,9 @@ def parse(
149149
child_archives: dict[str, EntryArchive] = {},
150150
):
151151
self.archive_writer.write(mainfile, archive, logger, child_archives)
152+
153+
# run the old parser
154+
# TODO remove
155+
from electronicparsers.abinit.parser import AbinitParser
156+
157+
AbinitParser().parse(mainfile, archive, logger)

src/nomad_simulation_parsers/parsers/ams/parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,9 @@ def parse(
6060
child_archives: dict[str, EntryArchive] = {},
6161
):
6262
self.archive_writer.write(mainfile, archive, logger, child_archives)
63+
64+
# run the old parser
65+
# TODO remove
66+
from electronicparsers.ams.parser import AMSParser
67+
68+
AMSParser().parse(mainfile, archive, logger)

src/nomad_simulation_parsers/parsers/crystal/parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,9 @@ def parse(
244244
child_arhives: dict[str, EntryArchive] = {},
245245
):
246246
self.archive_writer.write(mainfile, archive, logger, child_arhives)
247+
248+
# run the old parser
249+
# TODO remove
250+
from electronicparsers.crystal.parser import CrystalParser
251+
252+
CrystalParser().parse(mainfile, archive, logger)

src/nomad_simulation_parsers/parsers/exciting/parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,9 @@ def parse(
259259
child_archives: dict[str, EntryArchive] = None,
260260
):
261261
self.archive_writer.write(mainfile, archive, logger, child_archives)
262+
263+
# run the old parser
264+
# TODO remove
265+
from electronicparsers.exciting.parser import ExcitingParser
266+
267+
ExcitingParser().parse(mainfile, archive, logger)

src/nomad_simulation_parsers/parsers/octopus/parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,9 @@ def parse(
6464
child_archives: dict[str, EntryArchive] = {},
6565
) -> None:
6666
self.archive_writer.write(mainfile, archive, logger, child_archives)
67+
68+
# run the old parser
69+
# TODO remove
70+
from electronicparsers.octopus.parser import OctopusParser
71+
72+
OctopusParser().parse(mainfile, archive, logger)

src/nomad_simulation_parsers/parsers/quantumespresso/parser.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,32 @@ def parse(
280280
child_archives: dict[str, EntryArchive] = {},
281281
) -> None:
282282
self.archive_writer.write(mainfile, archive, logger, child_archives)
283+
284+
# run the old parser
285+
# TODO remove
286+
from electronicparsers.quantumespresso.parser import QuantumEspressoParser
287+
from workflowparsers.quantum_espresso_epw.parser import QuantumEspressoEPWParser
288+
from workflowparsers.quantum_espresso_phonon.parser import (
289+
QuantumEspressoPhononParser,
290+
)
291+
from workflowparsers.quantum_espresso_xspectra.parser import (
292+
QuantumEspressoXSpectraParser,
293+
)
294+
295+
program_re = re.compile(r'Program +(\w+)')
296+
program_name = ''
297+
with open(mainfile) as f:
298+
for line in f:
299+
match = program_re.search(line)
300+
if match:
301+
program_name = match.group(1)
302+
break
303+
304+
parser = {
305+
'pwscf': QuantumEspressoParser,
306+
'epw': QuantumEspressoEPWParser,
307+
'phonon': QuantumEspressoPhononParser,
308+
'xspectra': QuantumEspressoXSpectraParser,
309+
}.get(program_name.lower())
310+
if parser is not None:
311+
parser().parse(mainfile, archive, logger)

src/nomad_simulation_parsers/parsers/vasp/parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,9 @@ def parse(
3939
# remove annotations
4040
# TODO cache? put in close context
4141
remove_mapping_annotations(vasp.general.Simulation.m_def)
42+
43+
# run the old parser
44+
# TODO remove
45+
from electronicparsers.vasp.parser import VASPParser
46+
47+
VASPParser().parse(mainfile, archive, logger)

src/nomad_simulation_parsers/parsers/wannier90/parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,3 +429,9 @@ def parse(
429429
child_archives: dict[str, 'EntryArchive'] = {},
430430
) -> None:
431431
self.archive_writer.write(mainfile, archive, logger, child_archives)
432+
433+
# run the old parser
434+
# TODO remove
435+
from electronicparsers.wannier90.parser import Wannier90Parser
436+
437+
Wannier90Parser().parse(mainfile, archive, logger)

0 commit comments

Comments
 (0)