pyxem / orix

Analysing crystal orientations and symmetry in Python
https://orix.readthedocs.io
GNU General Public License v3.0
78 stars 45 forks source link

Miller dunder methods silently discards the phase #501

Open hakonanes opened 2 months ago

hakonanes commented 2 months ago

As reported by @viljarjf in https://github.com/pyxem/diffsims/issues/211, negating a Miller instance silently discards the phase. His example here shows the problem:

from orix.vector import Miller
from orix.crystal_map import Phase

p = Phase(point_group="m-3m")
v = Miller([1, 0, 0], phase=p)

print(v)
print(-v)

>>> Miller (1,), point group m-3m, xyz
[[1 0 0]]
>>> Miller (1,), point group None, xyz
[[-1  0  0]]