From c24edf28dcfe9f7a0cc93f4ac57c5b48cf7ab9d7 Mon Sep 17 00:00:00 2001 From: schuyann <43602823+schuyann@users.noreply.github.com> Date: Fri, 24 Jun 2022 10:12:35 +0200 Subject: [PATCH] fixed filenames (#149) The filename-specifier `f'.pdos_atm#{atom.index+1}*`' for example also includes atom numbers 10-19 when we only want to get atom number 1. Adding a bracket `f'.pdos_atm#{atom.index+1}(*'` should fix this issue. --- koopmans/calculators/_projwfc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koopmans/calculators/_projwfc.py b/koopmans/calculators/_projwfc.py index 665c5a0ff..32113919c 100644 --- a/koopmans/calculators/_projwfc.py +++ b/koopmans/calculators/_projwfc.py @@ -81,7 +81,7 @@ def generate_dos(self) -> GridDOSCollection: """ dos_list = [] for atom in self.atoms: - filenames = sorted(self.directory.glob(self.parameters.filpdos + f'.pdos_atm#{atom.index+1}*')) + filenames = sorted(self.directory.glob(self.parameters.filpdos + f'.pdos_atm#{atom.index+1}(*')) # The filename does not encode the principal quantum number n. In order to recover this number, we compare # the reported angular momentum quantum number l against the list of expected orbitals, and infer n # assuming only that the file corresponding to nl will come before (n+1)l