From c6c1878b13be5dfff792707109584931ba2b1614 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 12 Apr 2020 15:19:32 +0200 Subject: [PATCH 1/7] asterisk is the emphasize sign for restructured text not really needed here --- python/damask/_vtk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/damask/_vtk.py b/python/damask/_vtk.py index 4505a5ebc..58b43dc1f 100644 --- a/python/damask/_vtk.py +++ b/python/damask/_vtk.py @@ -120,9 +120,9 @@ class VTK: Parameters ---------- fname : str - Filename for reading. Valid extensions are *.vtr, *.vtu, *.vtp, and *.vtk. + Filename for reading. Valid extensions are .vtr, .vtu, .vtp, and .vtk. dataset_type : str, optional - Name of the vtk.vtkDataSet subclass when opening an *.vtk file. Valid types are vtkRectilinearGrid, + Name of the vtk.vtkDataSet subclass when opening an .vtk file. Valid types are vtkRectilinearGrid, vtkUnstructuredGrid, and vtkPolyData. """ From b6b98bd14f56fadaae4796fcfdbd582db1cd0497 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 12 Apr 2020 15:20:09 +0200 Subject: [PATCH 2/7] more meaningful --- python/damask/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/__init__.py b/python/damask/__init__.py index 9a01e8e62..0f343a581 100644 --- a/python/damask/__init__.py +++ b/python/damask/__init__.py @@ -1,4 +1,4 @@ -"""Main aggregator.""" +"""Tools for pre and post processing of DAMASK simulations.""" import os as _os import re as _re From aaeec16c66b4729b3d5ddec147bccbbc29535b6a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 12 Apr 2020 15:34:29 +0200 Subject: [PATCH 3/7] proper indentation for sphinx --- python/damask/_orientation.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/damask/_orientation.py b/python/damask/_orientation.py index 76475e057..aa1ba06ef 100644 --- a/python/damask/_orientation.py +++ b/python/damask/_orientation.py @@ -8,8 +8,8 @@ class Orientation: Crystallographic orientation. A crystallographic orientation contains a rotation and a lattice. - """ + """ __slots__ = ['rotation','lattice'] def __repr__(self): @@ -46,8 +46,10 @@ class Orientation: Disorientation between myself and given other orientation. Rotation axis falls into SST if SST == True. - (Currently requires same symmetry for both orientations. - Look into A. Heinz and P. Neumann 1991 for cases with differing sym.) + + Currently requires same symmetry for both orientations. + Look into A. Heinz and P. Neumann 1991 for cases with differing sym. + """ if self.lattice.symmetry != other.lattice.symmetry: raise NotImplementedError('disorientation between different symmetry classes not supported yet.') From 93c75cada3b872775c78b433452cd9dfd8aefd78 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 12 Apr 2020 15:38:38 +0200 Subject: [PATCH 4/7] numpydoc style --- python/damask/_rotation.py | 39 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index bea7aa5e6..e730ed845 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -11,33 +11,32 @@ def iszero(a): class Rotation: u""" Orientation stored with functionality for conversion to different representations. + The following conventions apply: + + - coordinate frames are right-handed. + - a rotation angle ω is taken to be positive for a counterclockwise rotation + when viewing from the end point of the rotation axis towards the origin. + - rotations will be interpreted in the passive sense. + - Euler angle triplets are implemented using the Bunge convention, + with the angular ranges as [0, 2π],[0, π],[0, 2π]. + - the rotation angle ω is limited to the interval [0, π]. + - the real part of a quaternion is positive, Re(q) > 0 + - P = -1 (as default). + + Examples + -------- + Rotate vector "a" (defined in coordinate system "A") to + coordinates "b" expressed in system "B": + + - b = Q * a + - b = np.dot(Q.asMatrix(),a) References ---------- D. Rowenhorst et al., Modelling and Simulation in Materials Science and Engineering 23:083501, 2015 https://doi.org/10.1088/0965-0393/23/8/083501 - Conventions - ----------- - Convention 1: Coordinate frames are right-handed. - Convention 2: A rotation angle ω is taken to be positive for a counterclockwise rotation - when viewing from the end point of the rotation axis towards the origin. - Convention 3: Rotations will be interpreted in the passive sense. - Convention 4: Euler angle triplets are implemented using the Bunge convention, - with the angular ranges as [0, 2π],[0, π],[0, 2π]. - Convention 5: The rotation angle ω is limited to the interval [0, π]. - Convention 6: the real part of a quaternion is positive, Re(q) > 0 - Convention 7: P = -1 (as default). - - Usage - ----- - Vector "a" (defined in coordinate system "A") is passively rotated - resulting in new coordinates "b" when expressed in system "B". - b = Q * a - b = np.dot(Q.asMatrix(),a) - """ - __slots__ = ['quaternion'] def __init__(self,quaternion = np.array([1.0,0.0,0.0,0.0])): From 66b928c5afce0891bd13793c42e0fafc8bba5324 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 13 May 2020 10:47:49 +0200 Subject: [PATCH 5/7] using doctest style https://docs.python.org/3/library/doctest.html https://numpy.org/doc/stable/docs/howto_document.html#sections (section 15) --- python/damask/_lattice.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/python/damask/_lattice.py b/python/damask/_lattice.py index 42aa0e9bd..f33cc66f7 100644 --- a/python/damask/_lattice.py +++ b/python/damask/_lattice.py @@ -229,19 +229,20 @@ class Symmetry: Return inverse pole figure color if requested. Bases are computed from - basis = {'cubic' : np.linalg.inv(np.array([[0.,0.,1.], # direction of red - [1.,0.,1.]/np.sqrt(2.), # direction of green - [1.,1.,1.]/np.sqrt(3.)]).T), # direction of blue - 'hexagonal' : np.linalg.inv(np.array([[0.,0.,1.], # direction of red - [1.,0.,0.], # direction of green - [np.sqrt(3.),1.,0.]/np.sqrt(4.)]).T), # direction of blue - 'tetragonal' : np.linalg.inv(np.array([[0.,0.,1.], # direction of red - [1.,0.,0.], # direction of green - [1.,1.,0.]/np.sqrt(2.)]).T), # direction of blue - 'orthorhombic' : np.linalg.inv(np.array([[0.,0.,1.], # direction of red - [1.,0.,0.], # direction of green - [0.,1.,0.]]).T), # direction of blue - } + >>> basis = {'cubic' : np.linalg.inv(np.array([[0.,0.,1.], # direction of red + ... [1.,0.,1.]/np.sqrt(2.), # direction of green + ... [1.,1.,1.]/np.sqrt(3.)]).T), # direction of blue + ... 'hexagonal' : np.linalg.inv(np.array([[0.,0.,1.], # direction of red + ... [1.,0.,0.], # direction of green + ... [np.sqrt(3.),1.,0.]/np.sqrt(4.)]).T), # direction of blue + ... 'tetragonal' : np.linalg.inv(np.array([[0.,0.,1.], # direction of red + ... [1.,0.,0.], # direction of green + ... [1.,1.,0.]/np.sqrt(2.)]).T), # direction of blue + ... 'orthorhombic': np.linalg.inv(np.array([[0.,0.,1.], # direction of red + ... [1.,0.,0.], # direction of green + ... [0.,1.,0.]]).T), # direction of blue + ... } + """ if self.lattice == 'cubic': basis = {'improper':np.array([ [-1. , 0. , 1. ], From b5b9bfaa99d1dc676b3177c22536a1607047148c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 13 May 2020 11:09:37 +0200 Subject: [PATCH 6/7] need space at end of definition list --- python/damask/_orientation.py | 1 + python/damask/_result.py | 7 ++++--- python/damask/_rotation.py | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/python/damask/_orientation.py b/python/damask/_orientation.py index 64fb98f45..a558ec85d 100644 --- a/python/damask/_orientation.py +++ b/python/damask/_orientation.py @@ -10,6 +10,7 @@ class Orientation: A crystallographic orientation contains a rotation and a lattice. """ + __slots__ = ['rotation','lattice'] def __repr__(self): diff --git a/python/damask/_result.py b/python/damask/_result.py index 9171682ff..a660885fe 100644 --- a/python/damask/_result.py +++ b/python/damask/_result.py @@ -316,9 +316,10 @@ class Result: Return groups that contain all requested datasets. Only groups within - - inc?????/constituent/*_*/* - - inc?????/materialpoint/*_*/* - - inc?????/geometry/* + - inc*/constituent/*/* + - inc*/materialpoint/*/* + - inc*/geometry/* + are considered as they contain user-relevant data. Single strings will be treated as list with one entry. diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index a7427e1f9..162a118b9 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -16,6 +16,7 @@ def iszero(a): class Rotation: u""" Orientation stored with functionality for conversion to different representations. + The following conventions apply: - coordinate frames are right-handed. @@ -42,6 +43,7 @@ class Rotation: https://doi.org/10.1088/0965-0393/23/8/083501 """ + __slots__ = ['quaternion'] def __init__(self,quaternion = np.array([1.0,0.0,0.0,0.0])): From b4de27bf6171f8efda6f073c582a14f8cded40a9 Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 25 May 2020 14:54:13 +0200 Subject: [PATCH 7/7] [skip ci] updated version information after successful test of v2.0.3-2514-g873b9fa8 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 3ba40668a..6d4d1897c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.3-2504-gcee9daff +v2.0.3-2514-g873b9fa8