Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sphinx eigenvalues parser fix #1209

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pyiron_atomistics/sphinx/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2284,10 +2284,10 @@ def n_steps(self):

def _parse_band(self, term):
arr = np.loadtxt(re.findall(term, self.log_main, re.MULTILINE))
shape = (-1, len(self.k_points), arr.shape[-1])
shape = (-1, len(self.k_points), 1, arr.shape[-1]) # 1 -> one spin channel for consistency and for the transpose to work
if self.spin_enabled:
shape = (-1, 2, len(self.k_points), shape[-1])
return arr.reshape(shape)
shape = (-1, len(self.k_points), 2, shape[-1]) #eigen values order in sphinx log: shape = (n_ionic_steps, n_kpoints, n_spin_channnels, n_bands)
return arr.reshape(shape).transpose(0,2,1,3) # the transpose to be consistent with other parsers and for get_density_of_states() to work

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