Open rozyczko opened 1 year ago
reproduced by
from easyDiffractionLib import Phase
phase = Phase(name="salt")
phase.add_atom('Na', 'Na', 0.0, 0.0, 0.0)
phase.add_atom('O', 'O', phase.atoms[0].fract_x, phase.atoms[0].fract_y, phase.atoms[0].fract_z)
print(phase.atoms[0].name, phase.atoms[0].get_parameters())
print(phase.atoms[1].name, phase.atoms[1].get_parameters())
While testing, Celine encountered an interesting issue with
add_atom
.The normal signature looks like
add_atom('H', 'H', 0.0, 0.0, 0.0)
with atom type and label as strings and fractional positions inside the cell as floats. However, one can passproperty
objects as fractional positions, e.g.add_atom('H', 'H', atom.fract_x, atom.fract_y, atom.fract_z)
and the method happily accepts these types, assigning proper values. However, in the process, some attributes get mixed and we getas the atom parameter list. Notice the lack of
occupancy
and doubly specifiedfract_z
.