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

Improvements to the documentation of the Lobsterenv module #3079

Merged
merged 25 commits into from
Jun 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Improve doc lobsterenv
  • Loading branch information
JaGeo committed Jun 19, 2023
commit fcf701f9f7ac709f42cbf16e4efe690d18595df9
36 changes: 22 additions & 14 deletions pymatgen/io/lobster/lobsterenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ def molecules_allowed(self):

def get_anion_types(self):
JaGeo marked this conversation as resolved.
Show resolved Hide resolved
"""
Return the types of anions present in crystal structure
Returns:
Return the types of anions present in crystal structure as a set
Returns: set of Element describing anions in the crystal structure
"""
if self.valences is None:
raise ValueError("No cations and anions defined")
Expand Down Expand Up @@ -352,21 +352,23 @@ def get_light_structure_environment(self, only_cation_environments=False, only_i

return lse

def get_info_icohps_to_neighbors(self, isites=None, onlycation_isites=True):
def get_info_icohps_to_neighbors(self, isites: list(int) | None = None, onlycation_isites: bool = True):
"""
this method Return information of cohps of neighbors
This method returns information on the icohps of neighbors for certain sites as identified by their site id.
This is useful for plotting the relevant cohps of a site in the structure.

Args:
isites: list of site ids, if isite==None, all isites will be used to add the icohps of the neighbors
onlycation_isites: will only use cations, if isite==[]
isites: list of site ids. If isite==None, all isites will be used to add the icohps of the neighbors
onlycation_isites: if True and if isite==None, it will only analyse the sites of the cations


Returns:
sum of icohps of neighbors to certain sites [given by the id in structure], number of bonds to this site,
labels (from ICOHPLIST) for
these bonds
[the latter is useful for plotting summed COHP plots],
list of the central isite for each label
Returns: tuple including
sum of icohp values of neighbors to the selected sites [given by the id in structure] (float),
list of summed icohp values for all identified interactions with neighbors (list),
number of identified bonds to the selected sites (int),
labels (from ICOHPLIST) for all identified bonds returned as a list of site names, e.g.,
['Ag3', 'O5'] [the latter is useful for plotting summed COHP plots] (list),
list of the central isite for each identified interaction (list)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return value of the function also has an "atoms" entry but I don't see that here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are correct. I somehow merged labels and atoms in the description.

"""
if self.valences is None and onlycation_isites:
raise ValueError("No valences are provided")
Expand Down Expand Up @@ -461,7 +463,8 @@ def get_info_cohps_to_neighbors(
summed_spin_channels=False,
):
"""
Return info about the cohps from all sites mentioned in isites with neighbors
Return info about the cohps as a summed cohp object and a label
from all sites mentioned in isites with neighbors

Args:
path_to_COHPCAR: str, path to COHPCAR
Expand Down Expand Up @@ -586,7 +589,12 @@ def get_info_icohps_between_neighbors(self, isites=None, onlycation_isites=True)
onlycation_isites: will only use cations, if isite==None

Returns:
tuple: summed_icohps, list_icohps, number_bonds, label_list, atoms_list
tuple:
sum of icohp values between the neighbors of the selected sites [given by the id in structure] (float),
list of summed icohp values for all identified interactions between neighbors (list),
number of identified bonds between the neighbors of the selected sites (int),
labels (from ICOHPLIST) for all identified bonds returned as a list of site names, e.g.,
['Ag3', 'O5'] [the latter is useful for plotting summed COHP plots] (list),
"""
lowerlimit = self.lowerlimit
upperlimit = self.upperlimit
Expand Down