def __init__(self, fileptr):
        """Parsing vasprun.xml by Expat

        Parameters
        ----------
        fileptr: binary stream
            Considering compatibility between python2.7 and 3.x, it is prepared
            as follows:

                import io
                io.open(filename, "rb")

        """

        import xml.parsers.expat

        self._fileptr = fileptr

        self._is_forces = False
        self._is_stress = False
        self._is_positions = False
        self._is_symbols = False
        self._is_basis = False
        self._is_volume = False
        self._is_energy = False
        self._is_k_weights = False
        self._is_eigenvalues = False
        self._is_epsilon = False
        self._is_born = False
        self._is_efermi = False
        self._is_generation = False
        self._is_divisions = False
        self._is_NELECT = False

        self._is_v = False
        self._is_i = False
        self._is_rc = False
        self._is_c = False
        self._is_set = False
        self._is_r = False
        self._is_field = False

        self._is_scstep = False
        self._is_structure = False
        self._is_projected = False
        self._is_proj_eig = False
        self._is_field_string = False
        self._is_pseudopotential = False

        self._all_forces = []
        self._all_stress = []
        self._all_points = []
        self._all_lattice = []
        self._all_energies = []
        self._all_volumes = []
        self._born = []
        self._forces = None
        self._stress = None
        self._points = None
        self._lattice = None
        self._energies = None
        self._epsilon = None
        self._born_atom = None
        self._k_weights = None
        self._k_mesh = None
        self._eigenvalues = None
        self._eig_state = [0, 0]
        self._projectors = None
        self._proj_state = [0, 0, 0]
        self._field_val = None
        self._pseudopotentials = []
        self._ps_atom = None

        self._p = xml.parsers.expat.ParserCreate()
        self._p.buffer_text = True
        self._p.StartElementHandler = self._start_element
        self._p.EndElementHandler = self._end_element
        self._p.CharacterDataHandler = self._char_data

        self.efermi = None
        self.symbols = None
        self.NELECT = None
def __init__ ( self , fileptr ) : import xml . parsers . expat self . _fileptr = fileptr self . _is_forces = False self . _is_stress = False self . _is_positions = False self . _is_symbols = False self . _is_basis = False self . _is_volume = False self . _is_energy = False self . _is_k_weights = False self . _is_eigenvalues = False self . _is_epsilon = False self . _is_born = False self . _is_efermi = False self . _is_generation = False self . _is_divisions = False self . _is_NELECT = False self . _is_v = False self . _is_i = False self . _is_rc = False self . _is_c = False self . _is_set = False self . _is_r = False self . _is_field = False self . _is_scstep = False self . _is_structure = False self . _is_projected = False self . _is_proj_eig = False self . _is_field_string = False self . _is_pseudopotential = False self . _all_forces = [ ] self . _all_stress = [ ] self . _all_points = [ ] self . _all_lattice = [ ] self . _all_energies = [ ] self . _all_volumes = [ ] self . _born = [ ] self . _forces = None self . _stress = None self . _points = None self . _lattice = None self . _energies = None self . _epsilon = None self . _born_atom = None self . _k_weights = None self . _k_mesh = None self . _eigenvalues = None self . _eig_state = [ 0 , 0 ] self . _projectors = None self . _proj_state = [ 0 , 0 , 0 ] self . _field_val = None self . _pseudopotentials = [ ] self . _ps_atom = None self . _p = xml . parsers . expat . ParserCreate ( ) self . _p . buffer_text = True self . _p . StartElementHandler = self . _start_element self . _p . EndElementHandler = self . _end_element self . _p . CharacterDataHandler = self . _char_data self . efermi = None self . symbols = None self . NELECT = None
Parsing vasprun.xml by Expat

        Parameters
        ----------
        fileptr: binary stream
            Considering compatibility between python2.7 and 3.x, it is prepared
            as follows:

                import io
                io.open(filename, "rb")