polishing of doc-strings

This commit is contained in:
Philip Eisenlohr 2022-08-09 09:29:22 -04:00
parent 3492dfcd3b
commit 009320c9fc
2 changed files with 6 additions and 6 deletions

View File

@ -117,7 +117,7 @@ class Rotation:
def __getitem__(self, def __getitem__(self,
item: Union[Tuple[int], int, bool, np.bool_, np.ndarray]): item: Union[Tuple[int], int, bool, np.bool_, np.ndarray]):
""" """
Return x[y]. Return self[item].
Return slice according to item. Return slice according to item.
@ -376,7 +376,7 @@ class Rotation:
""" """
Return self@other. Return self@other.
Rotate vector, second order tensor, or fourth order tensor. Rotate vector, second-order tensor, or fourth-order tensor.
Parameters Parameters
---------- ----------
@ -408,7 +408,7 @@ class Rotation:
R = self.as_matrix() R = self.as_matrix()
return np.einsum('...im,...jn,...ko,...lp,...mnop',R,R,R,R,other) return np.einsum('...im,...jn,...ko,...lp,...mnop',R,R,R,R,other)
else: else:
raise ValueError('can only rotate vectors, 2nd order tensors, and 4th order tensors') raise ValueError('can only rotate vectors, second-order tensors, and fourth-order tensors')
elif isinstance(other, Rotation): elif isinstance(other, Rotation):
raise TypeError('use "R1*R2", i.e. multiplication, to compose rotations "R1" and "R2"') raise TypeError('use "R1*R2", i.e. multiplication, to compose rotations "R1" and "R2"')
else: else:

View File

@ -54,7 +54,7 @@ class Table:
""" """
Return self==other. Return self==other.
Test equality of other table. Test equality of other.
""" """
return NotImplemented if not isinstance(other,Table) else \ return NotImplemented if not isinstance(other,Table) else \
@ -64,9 +64,9 @@ class Table:
def __getitem__(self, def __getitem__(self,
item: Union[slice, Tuple[slice, ...]]) -> 'Table': item: Union[slice, Tuple[slice, ...]]) -> 'Table':
""" """
Return x[y]. Return self[item].
Return table slice according to item. Return slice according to item.
Parameters Parameters
---------- ----------