Skip to content

Commit

Permalink
fixed a problem when orb-index files overflows
Browse files Browse the repository at this point in the history
This would result in wrong handling of the nsc
reads.
Now, only lines with valid input, should be accepted.

Signed-off-by: Nick Papior <[email protected]>
  • Loading branch information
zerothi committed Sep 25, 2024
1 parent ff911fc commit 886d911
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ we hit release version 1.0.0.
- added `timesSileSiesta` which can read siesta TIMES output

### Fixed
- a read problem for very big simulations (related to `orbindxSileSiesta`)
- bug-fix for `tbtSileTBtrans.Eindex` handling of integers, #829
This is a regression fix, integers will now be handled differently
than prior releases.
Expand Down
15 changes: 8 additions & 7 deletions src/sisl/io/siesta/orb_indx.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ def int_abs(i):

for _ in range(no_s):
line = self.readline().split()
isc = list(map(int_abs, line[12:15]))
if isc[0] > nsc[0]:
nsc[0] = isc[0]
if isc[1] > nsc[1]:
nsc[1] = isc[1]
if isc[2] > nsc[2]:
nsc[2] = isc[2]
if len(line) == 16:
isc = list(map(int_abs, line[12:15]))
if isc[0] > nsc[0]:
nsc[0] = isc[0]
if isc[1] > nsc[1]:
nsc[1] = isc[1]
if isc[2] > nsc[2]:
nsc[2] = isc[2]

return arrayi([n * 2 + 1 for n in nsc])

Expand Down

0 comments on commit 886d911

Please sign in to comment.