本文整理汇总了Python中pymatgen.analysis.structure_matcher.StructureMatcher.find_indexes方法的典型用法代码示例。如果您正苦于以下问题:Python StructureMatcher.find_indexes方法的具体用法?Python StructureMatcher.find_indexes怎么用?Python StructureMatcher.find_indexes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.analysis.structure_matcher.StructureMatcher
的用法示例。
在下文中一共展示了StructureMatcher.find_indexes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_class
# 需要导入模块: from pymatgen.analysis.structure_matcher import StructureMatcher [as 别名]
# 或者: from pymatgen.analysis.structure_matcher.StructureMatcher import find_indexes [as 别名]
def test_class(self):
# Tests entire class as single working unit
sm = StructureMatcher()
# Test group_structures and find_indices
out = sm.group_structures(self.struct_list)
self.assertEqual(sm.find_indexes(self.struct_list, out), [0, 0, 0, 1, 2, 3, 4, 0, 5, 6, 7, 8, 8, 9, 9, 10])
示例2: RemoveDuplicatesFilterTest
# 需要导入模块: from pymatgen.analysis.structure_matcher import StructureMatcher [as 别名]
# 或者: from pymatgen.analysis.structure_matcher.StructureMatcher import find_indexes [as 别名]
class RemoveDuplicatesFilterTest(unittest.TestCase):
def setUp(self):
with open(os.path.join(test_dir, "TiO2_entries.json"), "rb") as fp:
entries = json.load(fp, cls=PMGJSONDecoder)
self._struct_list = [e.structure for e in entries]
self._sm = StructureMatcher()
def test_filter(self):
transmuter = StandardTransmuter.from_structures(self._struct_list)
fil = RemoveDuplicatesFilter()
transmuter.apply_filter(fil)
out = self._sm.group_structures(transmuter.transformed_structures)
self.assertEqual(
self._sm.find_indexes(transmuter.transformed_structures, out), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
)
def test_to_from_dict(self):
fil = RemoveDuplicatesFilter()
d = fil.to_dict
self.assertIsInstance(RemoveDuplicatesFilter().from_dict(d), RemoveDuplicatesFilter)