Skip to content

Commit

Permalink
PwParser: Add support for QE v7.0
Browse files Browse the repository at this point in the history
Add the XML schema for Quantum ESPRESSO v7.0, along with a corresponding
test for the parsing.

Because the `.xsd` filename in the XML output of QE v7.0 is incorrect,
a check is also added in the `get_schema_filename` function to see if
the user was running QE v7.0. In that case, the correct filename is
returned.

We also use `pytest.mark.parametrize` to condense all the XML schema
tests into one.
  • Loading branch information
mbercx committed Jan 27, 2022
1 parent 93e3499 commit 568015c
Show file tree
Hide file tree
Showing 10 changed files with 2,503 additions and 94 deletions.
1,201 changes: 1,201 additions & 0 deletions aiida_quantumespresso/parsers/parse_xml/schemas/qes_211101.xsd

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions aiida_quantumespresso/parsers/parse_xml/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ def get_schema_filename(xml):
if element_root is None:
return None

# Patch for QE v7.0: The scheme file name was not updated in the `xsi.schemaLocation` element
try:
if element_root.find('general_info').find('creator').get('VERSION') == '7.0':
return 'qes_211101.xsd'
except AttributeError:
pass

element_schema_location = element_root.get(xml_schema_location_key)
# e.g. "http://www.quantum-espresso.org/ns/qes/qes-1.0 http://www.quantum-espresso.org/ns/qes/qes-1.0.xsd"

Expand Down
Loading

0 comments on commit 568015c

Please sign in to comment.