Skip to content

Commit

Permalink
Merge pull request #832 from pyiron/sphinx_sign
Browse files Browse the repository at this point in the history
Properly parse energy states and occupations
  • Loading branch information
pmrv authored Nov 7, 2022
2 parents dfd0330 + 9d968c4 commit cf713bb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions pyiron_atomistics/sphinx/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2125,22 +2125,17 @@ def n_steps(self):
return self._n_steps

def _parse_band(self, term):
fa = re.findall(term, self.log_main, re.MULTILINE)
arr = (
np.array(re.sub("[^0-9\. ]", "", "".join(fa)).split())
.astype(float)
.reshape(len(fa), -1)
)
arr = np.loadtxt(re.findall(term, self.log_main, re.MULTILINE))
shape = (-1, len(self.k_points), arr.shape[-1])
if self.spin_enabled:
shape = (-1, 2, len(self.k_points), shape[-1])
return arr.reshape(shape)

def get_band_energy(self):
return self._parse_band("final eig \[eV\].*$")
return self._parse_band(f"final eig \[eV\]:(.*)$")

def get_occupancy(self):
return self._parse_band("final focc:.*$")
return self._parse_band("final focc:(.*)$")

def get_convergence(self):
conv_dict = {
Expand Down

0 comments on commit cf713bb

Please sign in to comment.