-
Notifications
You must be signed in to change notification settings - Fork 868
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
Improve Bandoverlaps parser #3689
Merged
janosh
merged 8 commits into
materialsproject:master
from
naik-aakash:improve_bandoverlaps_parser
Mar 15, 2024
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7dace31
rewrite band_overlap_dict output format, update and add associated tests
naik-aakash dd2ffb1
rewrite band_overlap_dict output format, update and add associated tests
naik-aakash 5de8862
refactor
janosh b93fc23
fix failing test due to refactoring
naik-aakash 9e36b23
Merge branch 'materialsproject:master' into improve_bandoverlaps_parser
naik-aakash 4353768
address review comment and fix some pyright errors
naik-aakash 4b130e2
remote sync
naik-aakash 859d380
lst.append() -> concat
janosh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overlaps
is possibly unbound now from renamingoverlaps = []
torows
above.we don't check for this in CI yet due to way too many legacy violations but really should. related discussion in #3646
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @janosh, I did not get what you meant here. Can you please elaborate a bit more? I need the overlaps variable initialized in the previous if clause to properly store matrices for each k-point.
Is there anything I need to do ? I could not think of any other way to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problem is, if the code enters the
else
caseoverlaps
won't be declared, so Python will throw aNameError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, such case won't happen as per the current file format, it will always pass through the elif clause .
But I Will check for a few more examples that I have and see If I encounter any errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @janosh , I checked for about 20 different example files which I have, does not result in
NameError
due to file format , logic seems to work without breaking it 😃But if you have any better idea to get same outcome, I am happy to implement it. Just at this point I seem to have blanked out 😅 and cannot think of any alternatives
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could
pip install pyright
and run it on this file. it'll show you the error i mean. you just need to ensureoverlaps
is declared by all code pathsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @janosh , I have now addressed the errors which I could using pyright. If you think these are okay it could be merged.