Skip to content

Commit 844ac2c

Browse files
committed
Run old parsers
1 parent 626d04d commit 844ac2c

File tree

9 files changed

+72
-1
lines changed

9 files changed

+72
-1
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
@@ -240,3 +240,9 @@ def parse(
240240
child_arhives: dict[str, EntryArchive] = {},
241241
):
242242
self.archive_writer.write(mainfile, archive, logger, child_arhives)
243+
244+
# run the old parser
245+
# TODO remove
246+
from electronicparsers.crystal.parser import CrystalParser
247+
248+
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,5 +266,33 @@ def parse(
266266
logger: BoundLogger,
267267
child_archives: dict[str, EntryArchive] = {},
268268
) -> None:
269-
print('PPPP')
270269
self.archive_writer.write(mainfile, archive, logger, child_archives)
270+
271+
# run the old parser
272+
# TODO remove
273+
from electronicparsers.quantumespresso.parser import QuantumEspressoParser
274+
from workflowparsers.quantum_espresso_epw.parser import QuantumEspressoEPWParser
275+
from workflowparsers.quantum_espresso_phonon.parser import (
276+
QuantumEspressoPhononParser,
277+
)
278+
from workflowparsers.quantum_espresso_xspectra.parser import (
279+
QuantumEspressoXSpectraParser,
280+
)
281+
282+
program_re = re.compile(r'Program +(\w+)')
283+
program_name = ''
284+
with open(mainfile) as f:
285+
for line in f:
286+
match = program_re.search(line)
287+
if match:
288+
program_name = match.group(1)
289+
break
290+
291+
parser = {
292+
'pwscf': QuantumEspressoParser,
293+
'epw': QuantumEspressoEPWParser,
294+
'phonon': QuantumEspressoPhononParser,
295+
'xspectra': QuantumEspressoXSpectraParser,
296+
}.get(program_name.lower())
297+
if parser is not None:
298+
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)