Skip to content

Modify vasp.py for fixing issue #1021

WANG Lidong requested to merge LDongWang/ase:repair-double-prefix into master

Fix #1021 (closed)

When calling the function Vasp.get_dos(), it adds the prefix of the directory argument twice (at Vasp.get_k_point_weights() and Vasp.read_k_point_weights()), so it cannot find the IBZKPT file in the correct prefix/directory but in the prefix/prefix/directory and will raise a error message.

def get_k_point_weights(self):
    # First time adding prefix
    filename = self._indir('IBZKPT')
    return self.read_k_point_weights(filename)

and

def read_k_point_weights(self, filename):
    """Read k-point weighting. Normally named IBZKPT."""
    ...
    # Second time adding prefix
    lines = self.load_file(filename)
    ...

To fix this issue, get_k_point_weights is modified as:

def get_k_point_weights(self):
    filename = 'IBZKPT'
    return self.read_k_point_weights(filename)

Merge request reports