-
Notifications
You must be signed in to change notification settings - Fork 28
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
Structure graphs #63
Structure graphs #63
Conversation
Thanks. Will check it out. And, yes, pymatgen could be changed. |
Added the bonding-antibonding percentages as edge properties. The integral values obtained, however, don't match very well. So I still need to recheck. If you spot any error when reviewing, I would be happy to rectify it. |
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.
Thank you very much, Aakash. This is already a great start as always :). I have some suggestions and we can of course talk about it in more detail.
lobsterpy/structuregraph/__init__.py
Outdated
|
||
def __init__( | ||
self, | ||
path_to_calcdir: str, |
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 there is a chance that people have the files in different folders. I think we should support it.
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.
Yes, I thought it would be bit faster to use, and number of argument lists is bit large to type it out. But what you said also makes sense. So will revert it back to initial style.
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 there is a chance that people have the files in different folders. I think we should support it.
Yeah, have removed the hardcoding , so users can give path to files seperately.
lobsterpy/structuregraph/__init__.py
Outdated
def __init__( | ||
self, | ||
path_to_calcdir: str, | ||
add_additional_data_sg=True, |
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.
Maybe, we can already add an option to decide that COHP data is used for the determination of the bond strengths and bonds.
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.
Thanks @naik-aakash . I think it looks qvery good. Could you maybe make the suggested changes? I think, I can then merge it.
Hi Janine, Thnaks! The change suggested pending is for option to decide that COHP data used for the determination of the bond strengths and bonds. I think, I have made other suggested changes already. Will try to get it done as quickly as possible.
Added test case for |
Thanks @naik-aakash . I think it looks qvery good. Could you maybe make the suggested changes? I think, I can then merge it. |
) | ||
|
||
cba = analyze.condensed_bonding_analysis | ||
|
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.
Mayybe add a comment to describe what you are doing in each step?
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.
Added some additional comments as requested. Hope these do not cause linit errors , I just added via GUI on git
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 we need to add precommit to the workflows at some point.
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.
Yes
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.
Will do add it next time
Hi @JaGeo, let me know if anything more needs to be added or modified here. 😄 |
Hi @naik-aakash , how does the test coverage currently look like and how diverse were the structures you tested the code on so far? |
Hi @JaGeo, this PR could also be reviewed and merged |
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 @naik-aakash ,
thanks for writing this! Could you check if some of the objects aren't already part of Analysis? Charge or LobsterNeighbors? And, if there are ways to simplify the code and potentially speed it up.
) | ||
|
||
# Adds Mulliken and Löwdin charges as site properties to structure object (node properties) | ||
decorated_structure = Charge(self.path_to_charge).get_structure_with_charges( |
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.
Isn't the charge information already in LobsterNeighbors or the Analysis object or anything else?
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.
Oh yes, I just looked up into get_structure_with_charges method, I infact do not need to reinitialize the charge object just for that method. Thanks for the suggestion. Will implement the changes soon
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.
Ops, we cannot, Lobsterpy only has Mulliken charges, Loewdin Charges are not part of Analysis object
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 see! Thanks for checking!
) | ||
|
||
# Initialize automating bonding analysis from Lobsterpy based on ICOHP | ||
analyze = Analysis( |
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.
Isn't LobsterNeighbors part of the Analysis object? Can't you reuse this? I think we are currently running the same code multiple times which could be really slow.
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.
Indeed LobsterNeighbors
is part of Analysis object which can be reused, but as it is not initialized with ICOOP and ICOBI info when we create the analyze object. So the structure graph will not have ICOBI and ICOOP as edge properties.
I think to keep it simple we can simply not have them in single structure graph object?
It was implemented like this as ICOOP and ICOBI extension was not implemented before. Now we can simply have different sg objects for based on different analysis objects.
Let me know what you think of this? I will then make changes there
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.
Can't you add a kwarg or something to Analysis to pass the ICOBI, ICOOP to LobsterNeighbors stuff?
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 can, but I think it can be quite confusing if we are already planning to extend the analysis to COBIs and COOPs.
If the user does analysis for COBICAR, then sg will not have COHP info added with our current implementation in pymatgen. I will need to first update LobsterNeighbors if we want to go this way.
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.
Ideally, we can determine bonds based on ICOHP, ICOBI and add ICOHP, ICOBI values to each structure graph. I guess we will keep the current implementation for now and then think about improvements 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.
Thanks for checking!
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.
Ideally, we can determine bonds based on ICOHP, ICOBI and add ICOHP, ICOBI values to each structure graph. I guess we will keep the current implementation for now and then think about improvements later.
Yes, I agree 😄
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.
Thanks for checking!
You are welcome
Co-authored-by: J. George <JaGeo@users.noreply.github.com>
Co-authored-by: J. George <JaGeo@users.noreply.github.com>
@JaGeo, I have made the suggested changes. In the following days, I will try to make changes in pymatgen to switch to any icoxxlist as a base file for neighbor analysis and add additional data from the two types of files. Then I will raise another PR to improve the current implementation 😄 Let me know if anything more needs to be done before it can be merged :-) |
466b9d8
to
deab80a
Compare
…nto structure_graphs pull from remote
…nto structure_graphs fetch latest remote changes
…nto structure_graphs sync remote
Hi @JaGeo , here as well issues seem to be resolved so this could be merged |
Just resolved it now , should be fine. test files xD |
Hi Janine,
Pending
Also provide feedback on the way it is implemented.