From 8f0240c67bd6ff832b22c77435e790732b71f245 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 27 Apr 2022 08:59:55 -0400 Subject: [PATCH 1/4] avoid option clash in Orientation.from_fiber_component --- python/damask/_rotation.py | 14 +++++++------- python/tests/test_Orientation.py | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index 2963925c4..c0fea6a92 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -1096,8 +1096,8 @@ class Rotation: @staticmethod - def from_fiber_component(alpha: IntSequence, - beta: IntSequence, + def from_fiber_component(crystal: IntSequence, + sample: IntSequence, sigma: float = 0.0, shape: Union[int, IntSequence] = None, degrees: bool = True, @@ -1107,9 +1107,9 @@ class Rotation: Parameters ---------- - alpha : numpy.ndarray, shape (2) + crystal : numpy.ndarray, shape (2) Polar coordinates (phi from x, theta from z) of fiber direction in crystal frame. - beta : numpy.ndarray, shape (2) + sample : numpy.ndarray, shape (2) Polar coordinates (phi from x, theta from z) of fiber direction in sample frame. sigma : float, optional Standard deviation of (Gaussian) misorientation distribution. @@ -1117,15 +1117,15 @@ class Rotation: shape : int or sequence of ints, optional Shape of the returned array. Defaults to None, which gives a scalar. degrees : bool, optional - sigma, alpha, and beta are given in degrees. + sigma and polar coordinates are given in degrees. rng_seed : {None, int, array_like[ints], SeedSequence, BitGenerator, Generator}, optional A seed to initialize the BitGenerator. Defaults to None, i.e. unpredictable entropy will be pulled from the OS. """ rng = np.random.default_rng(rng_seed) - sigma_,alpha_,beta_ = (np.radians(coordinate) for coordinate in (sigma,alpha,beta)) if degrees else \ - map(np.array, (sigma,alpha,beta)) + sigma_,alpha_,beta_ = (np.radians(coordinate) for coordinate in (sigma,crystal,sample)) if degrees else \ + map(np.array, (sigma,crystal,sample)) d_cr = np.array([np.sin(alpha_[0])*np.cos(alpha_[1]), np.sin(alpha_[0])*np.sin(alpha_[1]), np.cos(alpha_[0])]) d_lab = np.array([np.sin( beta_[0])*np.cos( beta_[1]), np.sin( beta_[0])*np.sin( beta_[1]), np.cos( beta_[0])]) diff --git a/python/tests/test_Orientation.py b/python/tests/test_Orientation.py index 4a7b549fd..f1dcdc478 100644 --- a/python/tests/test_Orientation.py +++ b/python/tests/test_Orientation.py @@ -150,9 +150,9 @@ class TestOrientation: == np.eye(3)) def test_from_fiber_component(self): - r = Rotation.from_fiber_component(alpha=np.zeros(2),beta=np.zeros(2), + r = Rotation.from_fiber_component(crystal=np.zeros(2),sample=np.zeros(2), sigma=0.0,shape=1,rng_seed=0) - assert np.all(Orientation.from_fiber_component(alpha=np.zeros(2),beta=np.zeros(2), + assert np.all(Orientation.from_fiber_component(crystal=np.zeros(2),sample=np.zeros(2), sigma=0.0,shape=None,rng_seed=0,family='triclinic').quaternion == r.quaternion) From e0d285920226c53634ced57b42582736a3a68031 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 27 Apr 2022 17:25:39 +0200 Subject: [PATCH 2/4] better test coverage --- python/damask/_rotation.py | 2 +- python/tests/test_Orientation.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index c0fea6a92..f138fbb8a 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -551,7 +551,7 @@ class Rotation: Parameters ---------- degrees : bool, optional - Return angles in degrees. + Return angles in degrees. Defaults to False. Returns ------- diff --git a/python/tests/test_Orientation.py b/python/tests/test_Orientation.py index f1dcdc478..729967539 100644 --- a/python/tests/test_Orientation.py +++ b/python/tests/test_Orientation.py @@ -150,10 +150,12 @@ class TestOrientation: == np.eye(3)) def test_from_fiber_component(self): - r = Rotation.from_fiber_component(crystal=np.zeros(2),sample=np.zeros(2), + crystal = np.random.rand(2) * [180,360] + sample = np.random.rand(2) * [180,360] + r = Rotation.from_fiber_component(crystal=crystal,sample=sample, sigma=0.0,shape=1,rng_seed=0) - assert np.all(Orientation.from_fiber_component(crystal=np.zeros(2),sample=np.zeros(2), - sigma=0.0,shape=None,rng_seed=0,family='triclinic').quaternion + assert np.all(Orientation.from_fiber_component(crystal=crystal,sample=sample, + sigma=0.0,shape=None,rng_seed=0,lattice='cI').quaternion == r.quaternion) @pytest.mark.parametrize('kwargs',[ From 5776891b7585507cd23053d2888b6725de7b3ab8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 27 Apr 2022 22:49:33 +0200 Subject: [PATCH 3/4] typo: missing space --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d740bb2eb..c19d36f35 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -233,7 +233,7 @@ update_revision: - cd $(mktemp -d) - git clone -q git@git.damask.mpie.de:damask/DAMASK.git . - git pull - - exportVERSION=$(git describe ${CI_COMMIT_SHA}) + - export VERSION=$(git describe ${CI_COMMIT_SHA}) - echo ${VERSION:1} > VERSION - > git diff-index --quiet HEAD || From 07b95a3decc8fc1089ce948f0480a5425116cf73 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 28 Apr 2022 01:12:34 +0200 Subject: [PATCH 4/4] [skip ci] updated version information after successful test of v3.0.0-alpha6-266-g5776891b7 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8b1378917..c5ac07ef6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ - +3.0.0-alpha6-266-g5776891b7