Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
>>> symm2 = pychemia.symm.StructureSymmetry(fcc2)
>>> symm2.number()
225
>>> symm2.symbol()
u'Fm-3m'
"""
natom = self.structure.natom
cell = np.array(self.structure.cell.transpose(), dtype='double', order='C')
pos = np.zeros((natom * 4, 3), dtype='double')
pos[:natom] = self._reduced
numbers = np.zeros(natom * 4, dtype='intc')
numbers[:natom] = np.array(self._numbers, dtype='intc')
natom_bravais = spg.spglib.spg.refine_cell(cell, pos, numbers, natom, symprec, angle_tolerance)
if natom_bravais == 0:
return self.structure.copy()
cell = np.array(cell.T, dtype='double', order='C')
reduced = np.array(pos[:natom_bravais], dtype='double', order='C')
symbols = [self.structure.species[x] for x in (numbers[:natom_bravais] - 1)]
return Structure(cell=cell, symbols=symbols, reduced=reduced)