using slicing method

This commit is contained in:
Martin Diehl 2020-06-30 16:33:04 +02:00
parent c86e3e292c
commit be21d1289d
3 changed files with 6 additions and 6 deletions

View File

@ -192,7 +192,7 @@ class Orientation: # ToDo: make subclass of lattice and Rotation
"""TSL color of inverse pole figure for given axis."""
color = np.zeros(3,'d')
for o in self.equivalentOrientations():
for o in self.equivalent:
pole = o.rotation@axis # align crystal direction to axis
inSST,color = self.lattice.symmetry.inSST(pole,color=True)
if inSST: break

View File

@ -34,7 +34,7 @@ class TestOrientation:
for rot in [Rotation.from_random() for r in range(n//100)]:
R = damask.Orientation(rot,lattice)
color = R.IPFcolor(direction)
for equivalent in R.equivalentOrientations():
for equivalent in R.equivalent:
assert np.allclose(color,R.IPFcolor(direction))
@pytest.mark.parametrize('model',['Bain','KS','GT','GT_prime','NW','Pitsch'])

View File

@ -29,13 +29,13 @@ class TestOrientation_vec:
for s in range(len(ori_vec.lattice.symmetry.symmetryOperations())):
assert all(ori_vec.equivalent.rotation.as_Eulers()[s,0] == \
ori0.equivalentOrientations()[s].rotation.as_Eulers())
ori0.equivalent[s].rotation.as_Eulers())
assert all(ori_vec.equivalent.rotation.as_quaternion()[s,1] == \
ori1.equivalentOrientations()[s].rotation.as_quaternion())
ori1.equivalent[s].rotation.as_quaternion())
assert all(ori_vec.equivalent.rotation.as_Rodrigues()[s,2] == \
ori2.equivalentOrientations()[s].rotation.as_Rodrigues())
ori2.equivalent[s].rotation.as_Rodrigues())
assert all(ori_vec.equivalent.rotation.as_cubochoric()[s,3] == \
ori3.equivalentOrientations()[s].rotation.as_cubochoric())
ori3.equivalent[s].rotation.as_cubochoric())
@pytest.mark.parametrize('lattice',Lattice.lattices)
def test_inFZ_vec(self,lattice):