consistent naming

This commit is contained in:
Martin Diehl 2022-12-11 16:09:54 +01:00
parent c4883e2557
commit 0e48f04d0f
2 changed files with 6 additions and 6 deletions

View File

@ -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}')

View File

@ -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.)