예제 #1
0
    def test_get_site_fingerprints(self):
        """Test to check site fingerprinting."""
        finger = get_site_fingerprints(self.fe)[0]
        self.assertAlmostEqual(finger['body-centered cubic CN_8'], 0.576950507)

        # check as_dict option
        finger = get_site_fingerprints(self.fe, as_dict=False)[0]
        self.assertAlmostEqual(finger[30], 0.576950507)
예제 #2
0
    def __init__(self,
                 bonded_structure: StructureGraph,
                 use_symmetry_equivalent_sites: bool = False,
                 symprec: float = 0.01,
                 minimum_geometry_op: float = 0.4,
                 use_iupac_formula: bool = True):
        self.bonded_structure = bonded_structure
        self.use_iupac_formula = use_iupac_formula
        self.minimum_geometry_op = minimum_geometry_op

        self.site_fingerprints = get_site_fingerprints(
            bonded_structure.structure)

        sga = SpacegroupAnalyzer(bonded_structure.structure, symprec=symprec)
        equivalent_sites = sga.get_symmetry_dataset()['equivalent_atoms']
        if use_symmetry_equivalent_sites:
            self.equivalent_sites = list(equivalent_sites)
        else:
            self.equivalent_sites = self._calculate_equivalent_sites()

        self.symmetry_labels = self._calculate_symmetry_labels(
            equivalent_sites)