diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index 567c91d37..3d914f808 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -26,11 +26,8 @@ class Rotation: - 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 angular ranges of [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 + - Rotations will be interpreted in the passive sense, i.e. as rotation of + the coordinate frame. - P = -1 (as default). Examples @@ -879,6 +876,10 @@ class Rotation: reciprocal : bool, optional Basis vectors are given in reciprocal (instead of real) space. Defaults to False. + Returns + ------- + new : damask.Rotation + """ om = np.array(basis,dtype=float) if om.shape[-2:] != (3,3): raise ValueError('invalid shape') diff --git a/python/damask/util.py b/python/damask/util.py index dc19287f1..8f85a75b1 100644 --- a/python/damask/util.py +++ b/python/damask/util.py @@ -574,7 +574,7 @@ def _docstringer(docstring: _Union[str, _Callable], shift = min([len(line)-len(line.lstrip(' '))-indent for line in content]) extra = '\n'.join([(line[shift:] if shift > 0 else f'{" "*-shift}{line}') for line in content]) - docstring_ = _re.sub(fr'(^([ ]*){key}\s*\n\2{"-"*len(key)}[\n ]*[A-Za-z0-9 ]*: ([^\n]+\n)*)', + docstring_ = _re.sub(fr'(^([ ]*){key}\s*\n\2{"-"*len(key)}[\n ]*[A-Za-z0-9_ ]*: ([^\n]+\n)*)', fr'\1{extra}\n', docstring_,flags=_re.MULTILINE) @@ -590,7 +590,7 @@ def _docstringer(docstring: _Union[str, _Callable], +(return_class.__name__ if not isinstance(return_class,str) else return_class) ) - return _re.sub(r'(^([ ]*)Returns\s*\n\2-------\s*\n[ ]*[A-Za-z0-9 ]*: )(.*)\n', + return _re.sub(r'(^([ ]*)Returns\s*\n\2-------\s*\n[ ]*[A-Za-z0-9_ ]*: )(.*)\n', fr'\1{return_type_}\n', docstring_,flags=_re.MULTILINE)