Merge branch '235-docstring-of-orientation-from_axis_angle' into development
This commit is contained in:
commit
741aeab1d3
|
@ -26,11 +26,8 @@ class Rotation:
|
||||||
- Coordinate frames are right-handed.
|
- Coordinate frames are right-handed.
|
||||||
- A rotation angle ω is taken to be positive for a counterclockwise rotation
|
- 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.
|
when viewing from the end point of the rotation axis towards the origin.
|
||||||
- Rotations will be interpreted in the passive sense.
|
- Rotations will be interpreted in the passive sense, i.e. as rotation of
|
||||||
- Euler angle triplets are implemented using the Bunge convention,
|
the coordinate frame.
|
||||||
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
|
|
||||||
- P = -1 (as default).
|
- P = -1 (as default).
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
|
@ -879,6 +876,10 @@ class Rotation:
|
||||||
reciprocal : bool, optional
|
reciprocal : bool, optional
|
||||||
Basis vectors are given in reciprocal (instead of real) space. Defaults to False.
|
Basis vectors are given in reciprocal (instead of real) space. Defaults to False.
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
new : damask.Rotation
|
||||||
|
|
||||||
"""
|
"""
|
||||||
om = np.array(basis,dtype=float)
|
om = np.array(basis,dtype=float)
|
||||||
if om.shape[-2:] != (3,3): raise ValueError('invalid shape')
|
if om.shape[-2:] != (3,3): raise ValueError('invalid shape')
|
||||||
|
|
|
@ -574,7 +574,7 @@ def _docstringer(docstring: _Union[str, _Callable],
|
||||||
shift = min([len(line)-len(line.lstrip(' '))-indent for line in content])
|
shift = min([len(line)-len(line.lstrip(' '))-indent for line in content])
|
||||||
extra = '\n'.join([(line[shift:] if shift > 0 else
|
extra = '\n'.join([(line[shift:] if shift > 0 else
|
||||||
f'{" "*-shift}{line}') for line in content])
|
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',
|
fr'\1{extra}\n',
|
||||||
docstring_,flags=_re.MULTILINE)
|
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_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',
|
fr'\1{return_type_}\n',
|
||||||
docstring_,flags=_re.MULTILINE)
|
docstring_,flags=_re.MULTILINE)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue