diff --git a/python/converters/vasp/python/plotools.py b/python/converters/vasp/python/plotools.py index 09a5cb82..ef6b3b34 100644 --- a/python/converters/vasp/python/plotools.py +++ b/python/converters/vasp/python/plotools.py @@ -178,6 +178,8 @@ class ProjectorGroup: shell = self.shells[ish] shell.select_projectors(ib_win, nb_min, nb_max) + + ################################################################################ # # nelect_window @@ -192,7 +194,9 @@ class ProjectorGroup: rspin = 2.0 if ns_band == 1 else 1.0 for isp in xrange(ns_band): for ik in xrange(nk): - occ = el_struct.ferw[isp, ik, self.nb_min:self.nb_max+1] + ib1 = self.ib_win[ik, isp, 0] + ib2 = self.ib_win[ik, isp, 1] + occ = el_struct.ferw[isp, ik, ib1:ib2+1] kwght = el_struct.kmesh['kweights'][ik] self.nelect += occ.sum() * kwght * rspin @@ -521,6 +525,9 @@ def plo_output(conf_pars, el_struct, pshells, pgroups): head_dict['ewindow'] = (pgroup.emin, pgroup.emax) head_dict['nb_max'] = pgroup.nb_max +# Number of electrons within the window + head_dict['nelect'] = pgroup.nelect_window(el_struct) + head_shells = [] for ish in pgroup.ishells: shell = pgroup.shells[ish] diff --git a/python/converters/vasp/test/_plotools/test_plotools.py b/python/converters/vasp/test/_plotools/test_plotools.py index c26da112..7e7b7d84 100644 --- a/python/converters/vasp/test/_plotools/test_plotools.py +++ b/python/converters/vasp/test/_plotools/test_plotools.py @@ -5,6 +5,6 @@ import unittest if __name__ == '__main__': suite = unittest.TestLoader().discover('./') -# unittest.TextTestRunner(verbosity=2, buffer=True).run(suite) - unittest.TextTestRunner(verbosity=2, buffer=False).run(suite) + unittest.TextTestRunner(verbosity=2, buffer=True).run(suite) +# unittest.TextTestRunner(verbosity=2, buffer=False).run(suite)