Skip to content

Commit

Permalink
Bugfix parse Jij's for CPA without SOC
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippRue committed Nov 29, 2023
1 parent 7ce6bec commit 0ac4137
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aiida_kkr/tools/jij_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ def get_jijs_shells(jij_calc, verbose=False):
try:
tmp = np.loadtxt(f)
except:
# this means we could not read the file which happens, for example,
# in case of CPA where "&" characters are inserted to mark the end of block
f.seek(0)
txt = f.readlines()
tmp = np.loadtxt(txt[:-1])
txt = [line for line in txt if '&' not in line]
tmp = np.loadtxt(txt)
# sort by radius
jij_atom = tmp[tmp[:, 0].argsort()]
if len(jij_atom[0]) > 4:
Expand Down

0 comments on commit 0ac4137

Please sign in to comment.