Commit 8b67394f authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'new-vasp-parser-fixes' into 'reprocess'

New vasp parser fixes

See merge request !271
parents a1a5478c 47ef0819
Pipeline #94862 passed with stages
in 19 minutes and 36 seconds
Subproject commit ab933a73649ef7be873206a7fdb6aa0ef9886043
Subproject commit b6b2b661b29e363c41428a27ede19dcde77f63c9
......@@ -17,6 +17,7 @@ import os
import re
import numpy as np
from xml.etree import ElementTree
from lxml import etree
from nomad.parsing.file_parser import FileParser
......@@ -53,6 +54,13 @@ class XMLParser(FileParser):
self._file_handler = ElementTree.parse(self.open(self.mainfile)).getroot()
except Exception:
self.logger.error('failed to load xml file')
try:
# I cannot use the lxml XMLParser directly because it is not compatible with
# the ElementTree implementation.
xml = etree.parse(self.open(self.mainfile), parser=etree.XMLParser(recover=True))
self._file_handler = ElementTree.fromstring(etree.tostring(xml))
except Exception:
pass
self.init_parameters()
return self._file_handler
......
......@@ -39,6 +39,7 @@ mdtraj
mdanalysis
nomadcore
nomad_dos_fingerprints
lxml
# [infrastructure]
optimade==0.8.1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment