From b9019cc993fb829f923d7b1ebbb9772776a17229 Mon Sep 17 00:00:00 2001 From: mikibonacci Date: Wed, 9 Oct 2024 09:38:42 +0000 Subject: [PATCH] This fixes https://github.com/mikibonacci/aiidalab-qe-vibroscopy/issues/96 --- src/aiidalab_qe_vibroscopy/utils/phonons/result.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/aiidalab_qe_vibroscopy/utils/phonons/result.py b/src/aiidalab_qe_vibroscopy/utils/phonons/result.py index 534cc50..7b1296c 100644 --- a/src/aiidalab_qe_vibroscopy/utils/phonons/result.py +++ b/src/aiidalab_qe_vibroscopy/utils/phonons/result.py @@ -92,8 +92,13 @@ def export_phononworkchain_data(node, fermi_energy=None): ) for atom_contribution in index_dict[atom][:]: - dos_dict[atom] += pdos.get_y()[atom_contribution][1] - dos_dict["total_dos"] += pdos.get_y()[atom_contribution][1] + if len(pdos.get_y()) <= atom_contribution: + # I need this as for Al4, only one pdos tuple is provided... + # for Si2, actually, two are provided... + break + else: + dos_dict[atom] += pdos.get_y()[atom_contribution][1] + dos_dict["total_dos"] += pdos.get_y()[atom_contribution][1] dos = [] # The total dos parsed