consistent naming
This commit is contained in:
parent
c4883e2557
commit
0e48f04d0f
|
@ -630,7 +630,7 @@ class Rotation:
|
|||
|
||||
Returns
|
||||
-------
|
||||
axis_angle : numpy.ndarray, shape (...,4) or tuple ((...,3), (...)) if pair == True
|
||||
n_omega : numpy.ndarray, shape (...,4) or tuple ((...,3), (...)) if pair == True
|
||||
Axis and angle [n_1, n_2, n_3, ω] with ǀnǀ = 1 and ω ∈ [0,π]
|
||||
or ω ∈ [0,180] if degrees == True.
|
||||
|
||||
|
@ -820,7 +820,7 @@ class Rotation:
|
|||
return Rotation(Rotation._eu2qu(eu))
|
||||
|
||||
@staticmethod
|
||||
def from_axis_angle(axis_angle: np.ndarray,
|
||||
def from_axis_angle(n_omega: np.ndarray,
|
||||
degrees: bool = False,
|
||||
normalize: bool = False,
|
||||
P: Literal[1, -1] = -1) -> 'Rotation':
|
||||
|
@ -829,7 +829,7 @@ class Rotation:
|
|||
|
||||
Parameters
|
||||
----------
|
||||
axis_angle : numpy.ndarray, shape (...,4)
|
||||
n_omega : numpy.ndarray, shape (...,4)
|
||||
Axis and angle (n_1, n_2, n_3, ω) with ǀnǀ = 1 and ω ∈ [0,π]
|
||||
or ω ∈ [0,180] if degrees == True.
|
||||
degrees : bool, optional
|
||||
|
@ -844,7 +844,7 @@ class Rotation:
|
|||
new : damask.Rotation
|
||||
|
||||
"""
|
||||
ax = np.array(axis_angle,dtype=float)
|
||||
ax = np.array(n_omega,dtype=float)
|
||||
if ax.shape[:-2:-1] != (4,): raise ValueError('invalid shape')
|
||||
if abs(P) != 1: raise ValueError('P ∉ {-1,1}')
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ class TestOrientation:
|
|||
== np.eye(3))
|
||||
|
||||
def test_from_axis_angle(self):
|
||||
assert np.all(Orientation.from_axis_angle(axis_angle=[1,0,0,0],family='triclinic').as_matrix()
|
||||
assert np.all(Orientation.from_axis_angle(n_omega=[1,0,0,0],family='triclinic').as_matrix()
|
||||
== np.eye(3))
|
||||
|
||||
def test_from_basis(self):
|
||||
|
@ -210,7 +210,7 @@ class TestOrientation:
|
|||
@pytest.mark.parametrize('family',crystal_families)
|
||||
@pytest.mark.parametrize('angle',[10,20,30,40])
|
||||
def test_average(self,angle,family):
|
||||
o = Orientation.from_axis_angle(family=family,axis_angle=[[0,0,1,10],[0,0,1,angle]],degrees=True)
|
||||
o = Orientation.from_axis_angle(family=family,n_omega=[[0,0,1,10],[0,0,1,angle]],degrees=True)
|
||||
avg_angle = o.average().as_axis_angle(degrees=True,pair=True)[1]
|
||||
assert np.isclose(avg_angle,10+(angle-10)/2.)
|
||||
|
||||
|
|
Loading…
Reference in New Issue