Skip to content

Commit 947b52b

Browse files
committed
clean-up after 971
1 parent 55bd69f commit 947b52b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

changes/971.fix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed order in ORB_INDX files when species are not linear

src/sisl/io/siesta/orb_indx.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,16 @@ def crt_atom(i_s, tag, orbs):
101101
def crt_atom(i_s, tag, orbs):
102102
# Get the atom and add the orbitals
103103
kwargs = {}
104-
if atoms.atom[i_s].tag != tag:
104+
atom = atoms.atom[i_s]
105+
if atom.tag != tag:
105106
# we know ORB_INDX tag is correct
106107
kwargs["tag"] = tag
107-
if len(atoms.atom[i_s]) != len(orbs):
108+
if len(atom) != len(orbs):
108109
# only overwrite if # of orbitals don't match
109110
kwargs["orbitals"] = orbs
110111
if kwargs:
111-
return atoms.atom[i_s].copy(**kwargs)
112-
return atoms.atom[i_s]
112+
return atom.copy(**kwargs)
113+
return atom
113114

114115
# Now we begin by reading the atoms
115116
atom, orbs = [], []

0 commit comments

Comments
 (0)