From b1dab5f398aa133c0c3df6f4dd4dd20997b8e236 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 Aug 2021 10:44:38 +0200 Subject: [PATCH] tests working now --- python/damask/_orientation.py | 6 +++--- python/tests/test_Orientation.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/python/damask/_orientation.py b/python/damask/_orientation.py index 749115566..1bc28bc13 100644 --- a/python/damask/_orientation.py +++ b/python/damask/_orientation.py @@ -861,7 +861,7 @@ class Orientation(Rotation,Crystal): Parameters ---------- N_slip|N_twin : iterable of int - Number of deformation systems per deformation system. + Number of deformation systems per family of the deformation system. Use '*'. to select all. Returns @@ -871,7 +871,7 @@ class Orientation(Rotation,Crystal): Examples -------- - Schmid matrix (in lab frame) of first slip system of a face-centered + Schmid matrix (in lab frame) of first octahedral slip system of a face-centered cubic crystal in "Goss" orientation. >>> import damask @@ -889,7 +889,7 @@ class Orientation(Rotation,Crystal): kinematics = self.kinematics('slip' if N_twin is None else 'twin') active = N_slip if N_twin is None else N_twin - if active == '*': active = [len(a) for a in kinematics] + if active == '*': active = [len(a) for a in kinematics['direction']] d = self.to_frame(uvw=np.vstack([kinematics['direction'][i][:n] for i,n in enumerate(active)])) p = self.to_frame(hkl=np.vstack([kinematics['plane'][i][:n] for i,n in enumerate(active)])) diff --git a/python/tests/test_Orientation.py b/python/tests/test_Orientation.py index 7d820b2bf..0c735c20f 100644 --- a/python/tests/test_Orientation.py +++ b/python/tests/test_Orientation.py @@ -453,6 +453,7 @@ class TestOrientation: def test_Schmid_vectorize(self,lattice): O = Orientation.from_random(shape=4,lattice=lattice) # noqa for mode in ['slip','twin']: - P = O.Schmid(N_slip='*') if mode == 'slip' else O.Schmid(N_twin='*') + Ps = O.Schmid(N_slip='*') if mode == 'slip' else O.Schmid(N_twin='*') for i in range(4): - assert np.allclose(Orientation(rotation=O[i],lattice=lattice).Schmid(mode),P[:,i]) + P = O[i].Schmid(N_slip='*') if mode == 'slip' else O[i].Schmid(N_twin='*') + assert np.allclose(P,Ps[:,i])