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

Fix reading of basis #519

Merged
merged 2 commits into from
Nov 29, 2022
Merged

Fix reading of basis #519

merged 2 commits into from
Nov 29, 2022

Conversation

nils-wittemeier
Copy link
Contributor

This partially reverts a change that breaks the reading of basis orbitals from 'ORB_INDEX' file when multiple species are present.

The current version works fine for the first species. However, not for the next species.

This happens because, as soon as the loop reaches a new species it will try to create a new atom. Instead of first reading all orbitals for the new species. When checking whether the current i_s is in the list of species we really want to check it for the previous atom, not for the current atom.

Hence, moving the definition of i_s below is necessary.

I assume this change was intended to avoid, accessing i_s or spec before they are first assigned.

Instead, I suggest assigning an arbitrary value before the loop. The initial value will never to used, because i_a != ia can not happen before the second iteration of the loop.

@codecov
Copy link

codecov bot commented Nov 29, 2022

Codecov Report

Merging #519 (3108137) into main (3294555) will increase coverage by 0.22%.
The diff coverage is 100.00%.

❗ Current head 3108137 differs from pull request most recent head 9b7d872. Consider uploading reports for the commit 9b7d872 to get more accurate results

@@            Coverage Diff             @@
##             main     #519      +/-   ##
==========================================
+ Coverage   86.94%   87.17%   +0.22%     
==========================================
  Files         346      353       +7     
  Lines       44406    45392     +986     
==========================================
+ Hits        38609    39570     +961     
- Misses       5797     5822      +25     
Impacted Files Coverage Δ
sisl/io/siesta/orb_indx.py 95.83% <100.00%> (+0.05%) ⬆️
sisl/io/tbtrans/delta.py 92.73% <0.00%> (-1.11%) ⬇️
sisl/io/tbtrans/tests/test_delta.py 99.17% <0.00%> (-0.83%) ⬇️
sisl/supercell.py 96.00% <0.00%> (-0.17%) ⬇️
sisl/grid.py 86.01% <0.00%> (ø)
sisl/unit/base.py 82.08% <0.00%> (ø)
sisl/io/__init__.py 100.00% <0.00%> (ø)
sisl/geom/surfaces.py 96.64% <0.00%> (ø)
sisl/io/tbtrans/sile.py 100.00% <0.00%> (ø)
sisl/physics/overlap.py 80.00% <0.00%> (ø)
... and 30 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@zerothi zerothi merged commit eba4dec into zerothi:main Nov 29, 2022
@zerothi
Copy link
Owner

zerothi commented Nov 29, 2022

Thanks for this! :)

Could you please have a look #516 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants