Skip to content

Commit

Permalink
Add outcar parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ladinesa committed Oct 15, 2024
1 parent 9b71e4a commit 2318638
Show file tree
Hide file tree
Showing 7 changed files with 672 additions and 124 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ package-dir = { "" = "src" }
where = ["src"]

[project.entry-points.'nomad.plugin']
xml_parser = "nomad_parser_vasp.parsers:xml_entry_point"
vasp_parser = "nomad_parser_vasp.parsers:vasp_parser_entry_point"


[tool.cruft]
Expand Down
20 changes: 14 additions & 6 deletions src/nomad_parser_vasp/parsers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,32 @@
from pydantic import Field


class VasprunXMLEntryPoint(ParserEntryPoint):
class VASPParserEntryPoint(ParserEntryPoint):
parameter: int = Field(0, description='Custom configuration parameter')

def load(self):
from nomad.parsing import MatchingParserInterface

return MatchingParserInterface(
parser_class_name='nomad_parser_vasp.parsers.xml_parser.VasprunXMLParser',
parser_class_name='nomad_parser_vasp.parsers.parser.VASPParser',
**self.dict(),
)


xml_entry_point = VasprunXMLEntryPoint(
vasp_parser_entry_point = VASPParserEntryPoint(
name='nomad-parser-vasp',
python_package='nomad_parser_vasp',
code_name='VASP XML',
code_name='VASP',
code_category='ab initio',
entry_point_type='parser',
description='Parser for VASP output in XML format.',
mainfile_name_re='.*vasprun\.xml.*',
description='Parser for VASP XML and OUTCAR outputs',
mainfile_contents_re=(
r'^\s*<\?xml version="1\.0" encoding="ISO-8859-1"\?>\s*?\s*<modeling>?\s*<generator>?\s*<i '
r'name="program" type="string">\s*vasp\s*</i>?|^\svasp[\.\d]+.+?(?:\(build|complex)[\s\S]+?executed '
r'on'
),
mainfile_mime_re='(application/.*)|(text/.*)',
mainfile_name_re='.*[^/]*xml[^/]*',
mainfile_alternative=True,
supported_compressions=['gz', 'bz2', 'xz'],
)
29 changes: 0 additions & 29 deletions src/nomad_parser_vasp/parsers/myparser.py

This file was deleted.

Loading

0 comments on commit 2318638

Please sign in to comment.