本文整理汇总了Python中pymatgen.core.structure.IStructure.from_sites方法的典型用法代码示例。如果您正苦于以下问题:Python IStructure.from_sites方法的具体用法?Python IStructure.from_sites怎么用?Python IStructure.from_sites使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.core.structure.IStructure
的用法示例。
在下文中一共展示了IStructure.from_sites方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: featurize
# 需要导入模块: from pymatgen.core.structure import IStructure [as 别名]
# 或者: from pymatgen.core.structure.IStructure import from_sites [as 别名]
def featurize(self, structure):
"""Convert a pymatgen Structure to an immutable IStructure,
Args:
structure (`pymatgen.core.structure.Structure`): A structure.
Returns:
(`pymatgen.core.structure.IStructure`): An immutable IStructure
object.
"""
return [IStructure.from_sites(structure)]
示例2: get_all_nearest_neighbors
# 需要导入模块: from pymatgen.core.structure import IStructure [as 别名]
# 或者: from pymatgen.core.structure.IStructure import from_sites [as 别名]
def get_all_nearest_neighbors(method, structure):
"""Get the nearest neighbor list of a structure
Args:
method (NearNeighbor) - Method used to compute nearest neighbors
structure (IStructure) - Structure to study
Returns:
Output of `method.get_all_nn_info(structure)`
"""
# pymatgen does not hash Structure objects, so we need
# to convert from Structure to the immutatble IStructure method
if isinstance(structure, Structure):
structure = IStructure.from_sites(structure)
return _get_all_nearest_neighbors(method, structure)