Skip to content

Commit 9bc7cfc

Browse files
committed
MAINT: update Atom.xyz, _U arrays in place.
Use consistent in-place array assignment regardless of unset lattice or anisotropy.
1 parent 7c7f122 commit 9bc7cfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/diffpy/Structure/atom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def _set_xyz_cartn(self, value):
193193
if not self.lattice:
194194
self.xyz[:] = value
195195
else:
196-
self.xyz = self.lattice.fractional(value)
196+
self.xyz[:] = self.lattice.fractional(value)
197197
return
198198

199199
xyz_cartn = property(_get_xyz_cartn, _set_xyz_cartn, doc =
@@ -227,7 +227,7 @@ def _get_U(self):
227227
# for isotropic displacements assume first element
228228
# to be equal to the displacement value
229229
lat = self.lattice or cartesian_lattice
230-
self._U = self._U[0, 0] * lat.isotropicunit
230+
numpy.multiply(self._U[0, 0], lat.isotropicunit, out=self._U)
231231
return self._U
232232

233233
def _set_U(self, value):

0 commit comments

Comments
 (0)