@alpkulaksizoglu brought up an error in a recent disussion thread.
Namely, if you do the following:
import orix.crystal_map as ocm
import orix.vector as ove
import orix.plot as opl
import orix.quaternion.symmetry as osm # <-- side note, should we start doing this?
phase = ocm.Phase(point_group=osm.D6h)
rgbkey=opl.DirectionColorKeyTSL(osm.D6h)
m = ove.Miller(uvw=[1,2,3],phase=phase)
rgb = rgbkey.direction2color(m)
you get the following error:
AttributeError: 'Vector3d' object has no attribute 'phase'
Which seems to happen here because laue_group.fundamental_sector is a FundamentalSector and 'h' is a Miller, and when later on a cross product is attempted, laue_group.fundamental_sector doesn't have the phase attributed needed by Miller.cross
If we think users should be allowed to pass Miller objects into direction2color (I think that makes sense?) we just need to add the following if/then/else to DirectionColorKeyTSL.direction2color
if isinstance(direction, ove.Miller):
if direction.phase.point_group.laue == self.symmetry
direction = Vector3d(direction)
else:
"Input Error message here"
Otherwise, if there is a reason this should not be allowed, we should add a relevant error message.
@alpkulaksizoglu brought up an error in a recent disussion thread.
Namely, if you do the following:
you get the following error:
Which seems to happen here because
laue_group.fundamental_sectoris aFundamentalSectorand 'h' is aMiller, and when later on a cross product is attempted,laue_group.fundamental_sectordoesn't have thephaseattributed needed byMiller.crossIf we think users should be allowed to pass
Millerobjects intodirection2color(I think that makes sense?) we just need to add the following if/then/else toDirectionColorKeyTSL.direction2colorOtherwise, if there is a reason this should not be allowed, we should add a relevant error message.