Skip to content

Commit

Permalink
Ellipsoid repr bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrolexa committed Nov 20, 2023
1 parent 715f633 commit e4a1fab
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/apsg/feature/_tensor2.py
Original file line number Diff line number Diff line change
@@ -454,7 +454,7 @@ def orientation(self):
"""
Return the orientation of the maximum eigenvector.
"""
return self.eigenvectors()[np.argmax(self.eigenvalues())].direction % 180
return self.V1.direction % 180

@property
def e12(self) -> float:
@@ -493,10 +493,10 @@ class OrientationTensor2(Ellipse):
@classmethod
def from_features(cls, g) -> "OrientationTensor2":
"""
Return ``Ortensor`` of data in ``Group``
Return ``Ortensor`` of data in Vector2Set features
Args:
g: ``Group`` of ``Vector2``, ``Lin`` or ``Foliation``
g (Vector2Set): Set of features
Example:
>>> v = vec2set.random_vonmises(position=120)
10 changes: 6 additions & 4 deletions src/apsg/feature/_tensor3.py
Original file line number Diff line number Diff line change
@@ -661,8 +661,10 @@ class Ellipsoid(Tensor3):
"""

def __repr__(self) -> str:
return f"{Matrix3.__repr__(self)}\n\
(S1:{self.S1:.3g}, S2:{self.S2:.3g}, S3:{self.S3:.3g})"
return (
f"{Matrix3.__repr__(self)}\n"
f"(S1:{self.S1:.3g}, S2:{self.S2:.3g}, S3:{self.S3:.3g})"
)

@classmethod
def from_defgrad(cls, F, form="left", **kwargs) -> "Ellipsoid":
@@ -987,10 +989,10 @@ class OrientationTensor3(Ellipsoid):
@classmethod
def from_features(cls, g) -> "OrientationTensor3":
"""
Return ``Ortensor`` of data in ``Group``
Return ``Ortensor`` of data in Vector3Set of features
Args:
g: ``Group`` of ``Vector3``, ``Lin`` or ``Foliation``
g (Vector3Set): Set of features
Example:
>>> g = linset.random_fisher(position=lin(120,50))

0 comments on commit e4a1fab

Please sign in to comment.