From 2d1e933c3d3b2e0946620ad1ee3c723cfd99a7f3 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 20 Jul 2018 11:03:47 +0200 Subject: [PATCH 1/5] [skip ci] updated version information after successful test of v2.0.2-250-g8616a923 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8f6be5bd3..0acf5a908 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.2-241-g800f86e4 +v2.0.2-250-g8616a923 From 76cf126566b9505e83a52453df5d6a85dbf1bacd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 20 Jul 2018 15:58:21 +0200 Subject: [PATCH 2/5] [skip sc] not really a patch but enables python (3) skipping syntax check as executable files normally only exist in processing and installation --- installation/patch/python2to3.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 installation/patch/python2to3.sh diff --git a/installation/patch/python2to3.sh b/installation/patch/python2to3.sh new file mode 100755 index 000000000..1d86b0ce7 --- /dev/null +++ b/installation/patch/python2to3.sh @@ -0,0 +1,8 @@ +#! /usr/bin/env bash +if [ $1x != 3to2x ]; then + echo 'python2.7 to python' + find . -name '*.py' | xargs sed -i 's/usr\/bin\/env python2.7/usr\/bin\/env python/g' +else + echo 'python to python2.7' + find . -name '*.py' | xargs sed -i 's/usr\/bin\/env python/usr\/bin\/env python2.7/g' +fi From 5eff624d3f9ee978cba67c6e6063ea809488a0a2 Mon Sep 17 00:00:00 2001 From: Test User Date: Sun, 22 Jul 2018 06:39:27 +0200 Subject: [PATCH 3/5] [skip ci] updated version information after successful test of v2.0.2-253-gce203ca7 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0acf5a908..d340e860c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.2-250-g8616a923 +v2.0.2-253-gce203ca7 From 449449b5007b31cb42fdaa02236f8157c36e2136 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 28 Jul 2018 01:31:02 +0200 Subject: [PATCH 4/5] does the same as numpy.clip --- src/math.f90 | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/math.f90 b/src/math.f90 index 39adcbba4..edf2ff5a6 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -160,7 +160,7 @@ module math math_rotate_forward33, & math_rotate_backward33, & math_rotate_forward3333, & - math_limit + math_clip private :: & math_check, & halton @@ -1363,16 +1363,16 @@ pure function math_RtoEuler(R) sqhk =sqrt(R(1,3)*R(1,3)+R(2,3)*R(2,3)) ! calculate PHI - math_RtoEuler(2) = acos(math_limit(R(3,3)/sqhkl,-1.0_pReal, 1.0_pReal)) + math_RtoEuler(2) = acos(math_clip(R(3,3)/sqhkl,-1.0_pReal, 1.0_pReal)) if((math_RtoEuler(2) < 1.0e-8_pReal) .or. (pi-math_RtoEuler(2) < 1.0e-8_pReal)) then math_RtoEuler(3) = 0.0_pReal - math_RtoEuler(1) = acos(math_limit(R(1,1)/squvw, -1.0_pReal, 1.0_pReal)) + math_RtoEuler(1) = acos(math_clip(R(1,1)/squvw, -1.0_pReal, 1.0_pReal)) if(R(2,1) > 0.0_pReal) math_RtoEuler(1) = 2.0_pReal*pi-math_RtoEuler(1) else - math_RtoEuler(3) = acos(math_limit(R(2,3)/sqhk, -1.0_pReal, 1.0_pReal)) + math_RtoEuler(3) = acos(math_clip(R(2,3)/sqhk, -1.0_pReal, 1.0_pReal)) if(R(1,3) < 0.0) math_RtoEuler(3) = 2.0_pReal*pi-math_RtoEuler(3) - math_RtoEuler(1) = acos(math_limit(-R(3,2)/sin(math_RtoEuler(2)), -1.0_pReal, 1.0_pReal)) + math_RtoEuler(1) = acos(math_clip(-R(3,2)/sin(math_RtoEuler(2)), -1.0_pReal, 1.0_pReal)) if(R(3,1) < 0.0) math_RtoEuler(1) = 2.0_pReal*pi-math_RtoEuler(1) end if @@ -1654,7 +1654,7 @@ pure function math_qToEuler(qPassive) math_qToEuler(2) = acos(1.0_pReal-2.0_pReal*(q(2)**2+q(3)**2)) if (abs(math_qToEuler(2)) < 1.0e-6_pReal) then - math_qToEuler(1) = sign(2.0_pReal*acos(math_limit(q(1),-1.0_pReal, 1.0_pReal)),q(4)) + math_qToEuler(1) = sign(2.0_pReal*acos(math_clip(q(1),-1.0_pReal, 1.0_pReal)),q(4)) math_qToEuler(3) = 0.0_pReal else math_qToEuler(1) = atan2(+q(1)*q(3)+q(2)*q(4), q(1)*q(2)-q(3)*q(4)) @@ -1681,7 +1681,7 @@ pure function math_qToAxisAngle(Q) real(pReal) :: halfAngle, sinHalfAngle real(pReal), dimension(4) :: math_qToAxisAngle - halfAngle = acos(math_limit(Q(1),-1.0_pReal,1.0_pReal)) + halfAngle = acos(math_clip(Q(1),-1.0_pReal,1.0_pReal)) sinHalfAngle = sin(halfAngle) smallRotation: if (sinHalfAngle <= 1.0e-4_pReal) then @@ -1741,7 +1741,7 @@ real(pReal) pure function math_EulerMisorientation(EulerA,EulerB) cosTheta = (math_trace33(math_mul33x33(math_EulerToR(EulerB), & transpose(math_EulerToR(EulerA)))) - 1.0_pReal) * 0.5_pReal - math_EulerMisorientation = acos(math_limit(cosTheta,-1.0_pReal,1.0_pReal)) + math_EulerMisorientation = acos(math_clip(cosTheta,-1.0_pReal,1.0_pReal)) end function math_EulerMisorientation @@ -2052,7 +2052,7 @@ function math_eigenvectorBasisSym33(m) EB(3,3,3)=1.0_pReal else threeSimilarEigenvalues rho=sqrt(-3.0_pReal*P**3.0_pReal)/9.0_pReal - phi=acos(math_limit(-Q/rho*0.5_pReal,-1.0_pReal,1.0_pReal)) + phi=acos(math_clip(-Q/rho*0.5_pReal,-1.0_pReal,1.0_pReal)) values = 2.0_pReal*rho**(1.0_pReal/3.0_pReal)* & [cos(phi/3.0_pReal), & cos((phi+2.0_pReal*PI)/3.0_pReal), & @@ -2117,7 +2117,7 @@ function math_eigenvectorBasisSym33_log(m) EB(3,3,3)=1.0_pReal else threeSimilarEigenvalues rho=sqrt(-3.0_pReal*P**3.0_pReal)/9.0_pReal - phi=acos(math_limit(-Q/rho*0.5_pReal,-1.0_pReal,1.0_pReal)) + phi=acos(math_clip(-Q/rho*0.5_pReal,-1.0_pReal,1.0_pReal)) values = 2.0_pReal*rho**(1.0_pReal/3.0_pReal)* & [cos(phi/3.0_pReal), & cos((phi+2.0_pReal*PI)/3.0_pReal), & @@ -2229,7 +2229,7 @@ function math_eigenvaluesSym33(m) math_eigenvaluesSym33 = math_eigenvaluesSym(m) else rho=sqrt(-3.0_pReal*P**3.0_pReal)/9.0_pReal - phi=acos(math_limit(-Q/rho*0.5_pReal,-1.0_pReal,1.0_pReal)) + phi=acos(math_clip(-Q/rho*0.5_pReal,-1.0_pReal,1.0_pReal)) math_eigenvaluesSym33 = 2.0_pReal*rho**(1.0_pReal/3.0_pReal)* & [cos(phi/3.0_pReal), & cos((phi+2.0_pReal*PI)/3.0_pReal), & @@ -2614,7 +2614,7 @@ end function math_rotate_forward3333 !> @brief limits a scalar value to a certain range (either one or two sided) ! Will return NaN if left > right !-------------------------------------------------------------------------------------------------- -real(pReal) pure function math_limit(a, left, right) +real(pReal) pure function math_clip(a, left, right) use, intrinsic :: & IEEE_arithmetic @@ -2623,14 +2623,14 @@ real(pReal) pure function math_limit(a, left, right) real(pReal), intent(in), optional :: left, right - math_limit = min ( & + math_clip = min ( & max (merge(left, -huge(a), present(left)), a), & merge(right, huge(a), present(right)) & ) if (present(left) .and. present(right)) & - math_limit = merge (IEEE_value(1.0_pReal,IEEE_quiet_NaN),math_limit, left>right) + math_clip = merge (IEEE_value(1.0_pReal,IEEE_quiet_NaN),math_clip, left>right) -end function math_limit +end function math_clip end module math From 708e2e0ac580ce75409185f8d679d9b31837f5ba Mon Sep 17 00:00:00 2001 From: Test User Date: Sat, 28 Jul 2018 16:16:31 +0200 Subject: [PATCH 5/5] [skip ci] updated version information after successful test of v2.0.2-255-g449449b5 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index d340e860c..75fa254a5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.2-253-gce203ca7 +v2.0.2-255-g449449b5