Skip to content

Commit

Permalink
Fix num_of_atomic_wfc parsing + add test
Browse files Browse the repository at this point in the history
  • Loading branch information
mbercx committed Jul 24, 2024
1 parent e831ac9 commit 7c4fbb1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/aiida_quantumespresso/parsers/parse_xml/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ def parse_xml_post_6_2(xml):

num_k_points = band_structure['nks']
num_electrons = band_structure['nelec']
num_atomic_wfc = band_structure['num_of_atomic_wfc']

# In schema v240411 (QE v7.3.1), the `number_of_atomic_wfc` is moved to the `atomic_structure` tag as an attribute
num_atomic_wfc = band_structure.get('num_of_atomic_wfc', None) or outputs['atomic_structure']['@num_of_atomic_wfc']
num_bands = band_structure.get('nbnd', None)
num_bands_up = band_structure.get('nbnd_up', None)
num_bands_down = band_structure.get('nbnd_dw', None)
Expand Down
21 changes: 12 additions & 9 deletions tests/parsers/test_pw.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,18 @@ def test_pw_default_no_xml(
})


@pytest.mark.parametrize('xml_format', [
'190304',
'191206',
'200420',
'210716',
'211101',
'220603',
'230310',
])
@pytest.mark.parametrize(
'xml_format', [
'190304',
'191206',
'200420',
'210716',
'211101',
'220603',
'230310',
'240411',
]
)
def test_pw_default_xml(
fixture_localhost, generate_calc_job_node, generate_parser, generate_inputs, data_regression, xml_format
):
Expand Down

0 comments on commit 7c4fbb1

Please sign in to comment.