avoid name conflict with lattice parameter 'c'

This commit is contained in:
Sharan Roongta 2021-02-12 12:15:08 +01:00
parent f1b8978e21
commit 9e8a243d6f
2 changed files with 7 additions and 7 deletions

View File

@ -502,8 +502,8 @@ class Rotation:
Returns Returns
------- -------
c : numpy.ndarray of shape (...,3) x : numpy.ndarray of shape (...,3)
Cubochoric vector: (c_1, c_2, c_3), max(c_i) < 1/2*π^(2/3). Cubochoric vector: (x_1, x_2, x_3), max(x_i) < 1/2*π^(2/3).
""" """
return Rotation._qu2cu(self.quaternion) return Rotation._qu2cu(self.quaternion)
@ -748,20 +748,20 @@ class Rotation:
return Rotation(Rotation._ho2qu(ho)) return Rotation(Rotation._ho2qu(ho))
@staticmethod @staticmethod
def from_cubochoric(c, def from_cubochoric(x,
P = -1): P = -1):
""" """
Initialize from cubochoric vector. Initialize from cubochoric vector.
Parameters Parameters
---------- ----------
c : numpy.ndarray of shape (...,3) x : numpy.ndarray of shape (...,3)
Cubochoric vector: (c_1, c_2, c_3), max(c_i) < 1/2*π^(2/3). Cubochoric vector: (x_1, x_2, x_3), max(x_i) < 1/2*π^(2/3).
P : int {-1,1}, optional P : int {-1,1}, optional
Convention used. Defaults to -1. Convention used. Defaults to -1.
""" """
cu = np.array(c,dtype=float) cu = np.array(x,dtype=float)
if cu.shape[:-2:-1] != (3,): if cu.shape[:-2:-1] != (3,):
raise ValueError('Invalid shape.') raise ValueError('Invalid shape.')
if abs(P) != 1: if abs(P) != 1:

View File

@ -118,7 +118,7 @@ class TestOrientation:
== np.eye(3)) == np.eye(3))
def test_from_cubochoric(self): def test_from_cubochoric(self):
assert np.all(Orientation.from_cubochoric(c=np.zeros(3),lattice='triclinic').as_matrix() assert np.all(Orientation.from_cubochoric(x=np.zeros(3),lattice='triclinic').as_matrix()
== np.eye(3)) == np.eye(3))
def test_from_spherical_component(self): def test_from_spherical_component(self):