diff --git a/src/beignet/ops/__init__.py b/src/beignet/ops/__init__.py index 744e681776..76e50321fc 100644 --- a/src/beignet/ops/__init__.py +++ b/src/beignet/ops/__init__.py @@ -1,38 +1,38 @@ from ._geometry import ( apply_euler_angle, apply_rotation_matrix, - apply_rotation_quaternion, + apply_quaternion, apply_rotation_vector, - compose_rotation_quaternion, + compose_quaternion, euler_angle_identity, euler_angle_magnitude, euler_angle_to_rotation_matrix, - euler_angle_to_rotation_quaternion, + euler_angle_to_quaternion, euler_angle_to_rotation_vector, invert_euler_angle, invert_rotation_matrix, - invert_rotation_quaternion, + invert_quaternion, invert_rotation_vector, - mean_rotation_quaternion, + mean_quaternion, random_euler_angle, random_rotation_matrix, - random_rotation_quaternion, + random_quaternion, random_rotation_vector, rotation_matrix_identity, rotation_matrix_magnitude, rotation_matrix_to_euler_angle, - rotation_matrix_to_rotation_quaternion, + rotation_matrix_to_quaternion, rotation_matrix_to_rotation_vector, - rotation_quaternion_identity, - rotation_quaternion_magnitude, - rotation_quaternion_to_euler_angle, - rotation_quaternion_to_rotation_matrix, - rotation_quaternion_to_rotation_vector, + quaternion_identity, + quaternion_magnitude, + quaternion_to_euler_angle, + quaternion_to_rotation_matrix, + quaternion_to_rotation_vector, rotation_vector_identity, rotation_vector_magnitude, rotation_vector_to_euler_angle, rotation_vector_to_rotation_matrix, - rotation_vector_to_rotation_quaternion, + rotation_vector_to_quaternion, translation_identity, ) from ._interpolation import slerp @@ -40,38 +40,38 @@ __all__ = [ "apply_euler_angle", "apply_rotation_matrix", - "apply_rotation_quaternion", + "apply_quaternion", "apply_rotation_vector", - "compose_rotation_quaternion", + "compose_quaternion", "euler_angle_identity", "euler_angle_magnitude", "euler_angle_to_rotation_matrix", - "euler_angle_to_rotation_quaternion", + "euler_angle_to_quaternion", "euler_angle_to_rotation_vector", "invert_euler_angle", "invert_rotation_matrix", - "invert_rotation_quaternion", + "invert_quaternion", "invert_rotation_vector", - "mean_rotation_quaternion", + "mean_quaternion", "random_euler_angle", "random_rotation_matrix", - "random_rotation_quaternion", + "random_quaternion", "random_rotation_vector", "rotation_matrix_identity", "rotation_matrix_magnitude", "rotation_matrix_to_euler_angle", - "rotation_matrix_to_rotation_quaternion", + "rotation_matrix_to_quaternion", "rotation_matrix_to_rotation_vector", - "rotation_quaternion_identity", - "rotation_quaternion_magnitude", - "rotation_quaternion_to_euler_angle", - "rotation_quaternion_to_rotation_matrix", - "rotation_quaternion_to_rotation_vector", + "quaternion_identity", + "quaternion_magnitude", + "quaternion_to_euler_angle", + "quaternion_to_rotation_matrix", + "quaternion_to_rotation_vector", "rotation_vector_identity", "rotation_vector_magnitude", "rotation_vector_to_euler_angle", "rotation_vector_to_rotation_matrix", - "rotation_vector_to_rotation_quaternion", + "rotation_vector_to_quaternion", "slerp", "translation_identity", ] diff --git a/src/beignet/ops/_geometry/__init__.py b/src/beignet/ops/_geometry/__init__.py index 40265c0040..2fd67e25bf 100644 --- a/src/beignet/ops/_geometry/__init__.py +++ b/src/beignet/ops/_geometry/__init__.py @@ -1,37 +1,37 @@ from ._transformations import ( apply_euler_angle, apply_rotation_matrix, - apply_rotation_quaternion, + apply_quaternion, apply_rotation_vector, - compose_rotation_quaternion, + compose_quaternion, euler_angle_identity, euler_angle_magnitude, euler_angle_to_rotation_matrix, - euler_angle_to_rotation_quaternion, + euler_angle_to_quaternion, euler_angle_to_rotation_vector, invert_euler_angle, invert_rotation_matrix, - invert_rotation_quaternion, + invert_quaternion, invert_rotation_vector, - mean_rotation_quaternion, + mean_quaternion, random_euler_angle, random_rotation_matrix, - random_rotation_quaternion, + random_quaternion, random_rotation_vector, rotation_matrix_identity, rotation_matrix_magnitude, rotation_matrix_to_euler_angle, - rotation_matrix_to_rotation_quaternion, + rotation_matrix_to_quaternion, rotation_matrix_to_rotation_vector, - rotation_quaternion_identity, - rotation_quaternion_magnitude, - rotation_quaternion_to_euler_angle, - rotation_quaternion_to_rotation_matrix, - rotation_quaternion_to_rotation_vector, + quaternion_identity, + quaternion_magnitude, + quaternion_to_euler_angle, + quaternion_to_rotation_matrix, + quaternion_to_rotation_vector, rotation_vector_identity, rotation_vector_magnitude, rotation_vector_to_euler_angle, rotation_vector_to_rotation_matrix, - rotation_vector_to_rotation_quaternion, + rotation_vector_to_quaternion, translation_identity, ) diff --git a/src/beignet/ops/_geometry/_transformations/__init__.py b/src/beignet/ops/_geometry/_transformations/__init__.py index 0ab7190685..6ecfa2e942 100644 --- a/src/beignet/ops/_geometry/_transformations/__init__.py +++ b/src/beignet/ops/_geometry/_transformations/__init__.py @@ -1,37 +1,37 @@ from ._rotations import ( apply_euler_angle, apply_rotation_matrix, - apply_rotation_quaternion, + apply_quaternion, apply_rotation_vector, - compose_rotation_quaternion, + compose_quaternion, euler_angle_identity, euler_angle_magnitude, euler_angle_to_rotation_matrix, - euler_angle_to_rotation_quaternion, + euler_angle_to_quaternion, euler_angle_to_rotation_vector, invert_euler_angle, invert_rotation_matrix, - invert_rotation_quaternion, + invert_quaternion, invert_rotation_vector, - mean_rotation_quaternion, + mean_quaternion, random_euler_angle, random_rotation_matrix, - random_rotation_quaternion, + random_quaternion, random_rotation_vector, rotation_matrix_identity, rotation_matrix_magnitude, rotation_matrix_to_euler_angle, - rotation_matrix_to_rotation_quaternion, + rotation_matrix_to_quaternion, rotation_matrix_to_rotation_vector, - rotation_quaternion_identity, - rotation_quaternion_magnitude, - rotation_quaternion_to_euler_angle, - rotation_quaternion_to_rotation_matrix, - rotation_quaternion_to_rotation_vector, + quaternion_identity, + quaternion_magnitude, + quaternion_to_euler_angle, + quaternion_to_rotation_matrix, + quaternion_to_rotation_vector, rotation_vector_identity, rotation_vector_magnitude, rotation_vector_to_euler_angle, rotation_vector_to_rotation_matrix, - rotation_vector_to_rotation_quaternion, + rotation_vector_to_quaternion, ) from ._translations import translation_identity diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/__init__.py b/src/beignet/ops/_geometry/_transformations/_rotations/__init__.py index 3c47d0591f..3c90df6967 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/__init__.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/__init__.py @@ -1,45 +1,45 @@ from ._apply_euler_angle import apply_euler_angle from ._apply_rotation_matrix import apply_rotation_matrix -from ._apply_rotation_quaternion import ( - apply_rotation_quaternion, +from ._apply_quaternion import ( + apply_quaternion, ) from ._apply_rotation_vector import apply_rotation_vector -from ._compose_rotation_quaternion import compose_rotation_quaternion +from ._compose_quaternion import compose_quaternion from ._euler_angle_identity import euler_angle_identity from ._euler_angle_magnitude import euler_angle_magnitude from ._euler_angle_to_rotation_matrix import euler_angle_to_rotation_matrix -from ._euler_angle_to_rotation_quaternion import ( - euler_angle_to_rotation_quaternion, +from ._euler_angle_to_quaternion import ( + euler_angle_to_quaternion, ) from ._euler_angle_to_rotation_vector import euler_angle_to_rotation_vector from ._invert_euler_angle import invert_euler_angle from ._invert_rotation_matrix import invert_rotation_matrix -from ._invert_rotation_quaternion import invert_rotation_quaternion +from ._invert_quaternion import invert_quaternion from ._invert_rotation_vector import invert_rotation_vector -from ._mean_rotation_quaternion import mean_rotation_quaternion +from ._mean_quaternion import mean_quaternion from ._random_euler_angle import random_euler_angle from ._random_rotation_matrix import random_rotation_matrix -from ._random_rotation_quaternion import random_rotation_quaternion +from ._random_quaternion import random_quaternion from ._random_rotation_vector import random_rotation_vector from ._rotation_matrix_identity import rotation_matrix_identity from ._rotation_matrix_magnitude import rotation_matrix_magnitude from ._rotation_matrix_to_euler_angle import rotation_matrix_to_euler_angle -from ._rotation_matrix_to_rotation_quaternion import ( - rotation_matrix_to_rotation_quaternion, +from ._rotation_matrix_to_quaternion import ( + rotation_matrix_to_quaternion, ) from ._rotation_matrix_to_rotation_vector import ( rotation_matrix_to_rotation_vector, ) -from ._rotation_quaternion_identity import rotation_quaternion_identity -from ._rotation_quaternion_magnitude import rotation_quaternion_magnitude -from ._rotation_quaternion_to_euler_angle import ( - rotation_quaternion_to_euler_angle, +from ._quaternion_identity import quaternion_identity +from ._quaternion_magnitude import quaternion_magnitude +from ._quaternion_to_euler_angle import ( + quaternion_to_euler_angle, ) -from ._rotation_quaternion_to_rotation_matrix import ( - rotation_quaternion_to_rotation_matrix, +from ._quaternion_to_rotation_matrix import ( + quaternion_to_rotation_matrix, ) -from ._rotation_quaternion_to_rotation_vector import ( - rotation_quaternion_to_rotation_vector, +from ._quaternion_to_rotation_vector import ( + quaternion_to_rotation_vector, ) from ._rotation_vector_identity import rotation_vector_identity from ._rotation_vector_magnitude import rotation_vector_magnitude @@ -47,6 +47,6 @@ from ._rotation_vector_to_rotation_matrix import ( rotation_vector_to_rotation_matrix, ) -from ._rotation_vector_to_rotation_quaternion import ( - rotation_vector_to_rotation_quaternion, +from ._rotation_vector_to_quaternion import ( + rotation_vector_to_quaternion, ) diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_apply_rotation_quaternion.py b/src/beignet/ops/_geometry/_transformations/_rotations/_apply_quaternion.py similarity index 89% rename from src/beignet/ops/_geometry/_transformations/_rotations/_apply_rotation_quaternion.py rename to src/beignet/ops/_geometry/_transformations/_rotations/_apply_quaternion.py index 5200c09769..cac4e1963e 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_apply_rotation_quaternion.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_apply_quaternion.py @@ -1,12 +1,12 @@ from torch import Tensor -from ._rotation_quaternion_to_rotation_matrix import ( - rotation_quaternion_to_rotation_matrix, +from ._quaternion_to_rotation_matrix import ( + quaternion_to_rotation_matrix, ) from ._apply_rotation_matrix import apply_rotation_matrix -def apply_rotation_quaternion( +def apply_quaternion( input: Tensor, rotation: Tensor, inverse: bool | None = False, @@ -45,7 +45,7 @@ def apply_rotation_quaternion( """ return apply_rotation_matrix( input, - rotation_quaternion_to_rotation_matrix( + quaternion_to_rotation_matrix( rotation, ), inverse, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_apply_rotation_vector.py b/src/beignet/ops/_geometry/_transformations/_rotations/_apply_rotation_vector.py index 87adbe9386..241846d081 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_apply_rotation_vector.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_apply_rotation_vector.py @@ -1,10 +1,10 @@ from torch import Tensor -from ._rotation_quaternion_to_rotation_matrix import ( - rotation_quaternion_to_rotation_matrix, +from ._quaternion_to_rotation_matrix import ( + quaternion_to_rotation_matrix, ) -from ._rotation_vector_to_rotation_quaternion import ( - rotation_vector_to_rotation_quaternion, +from ._rotation_vector_to_quaternion import ( + rotation_vector_to_quaternion, ) from ._apply_rotation_matrix import apply_rotation_matrix @@ -53,8 +53,8 @@ def apply_rotation_vector( """ return apply_rotation_matrix( input, - rotation_quaternion_to_rotation_matrix( - rotation_vector_to_rotation_quaternion( + quaternion_to_rotation_matrix( + rotation_vector_to_quaternion( rotation, degrees, ), diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_compose_rotation_quaternion.py b/src/beignet/ops/_geometry/_transformations/_rotations/_compose_quaternion.py similarity index 98% rename from src/beignet/ops/_geometry/_transformations/_rotations/_compose_rotation_quaternion.py rename to src/beignet/ops/_geometry/_transformations/_rotations/_compose_quaternion.py index 49da39c89d..35d0b30ae9 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_compose_rotation_quaternion.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_compose_quaternion.py @@ -2,7 +2,7 @@ from torch import Tensor -def compose_rotation_quaternion( +def compose_quaternion( input: Tensor, other: Tensor, canonical: bool = False, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_euler_angle_identity.py b/src/beignet/ops/_geometry/_transformations/_rotations/_euler_angle_identity.py index 8e7a810f9a..40c716cf3a 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_euler_angle_identity.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_euler_angle_identity.py @@ -1,9 +1,9 @@ import torch from torch import Tensor -from ._rotation_quaternion_identity import rotation_quaternion_identity -from ._rotation_quaternion_to_euler_angle import ( - rotation_quaternion_to_euler_angle, +from ._quaternion_identity import quaternion_identity +from ._quaternion_to_euler_angle import ( + quaternion_to_euler_angle, ) @@ -56,8 +56,8 @@ def euler_angle_identity( identity_euler_angles : Tensor, shape (size, 3) Identity Euler angles. """ - return rotation_quaternion_to_euler_angle( - rotation_quaternion_identity( + return quaternion_to_euler_angle( + quaternion_identity( size, out=out, dtype=dtype, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_euler_angle_magnitude.py b/src/beignet/ops/_geometry/_transformations/_rotations/_euler_angle_magnitude.py index 901f677222..3429062d09 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_euler_angle_magnitude.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_euler_angle_magnitude.py @@ -1,9 +1,9 @@ from torch import Tensor -from ._euler_angle_to_rotation_quaternion import ( - euler_angle_to_rotation_quaternion, +from ._euler_angle_to_quaternion import ( + euler_angle_to_quaternion, ) -from ._rotation_quaternion_magnitude import rotation_quaternion_magnitude +from ._quaternion_magnitude import quaternion_magnitude def euler_angle_magnitude( @@ -32,8 +32,8 @@ def euler_angle_magnitude( euler_angle_magnitudes: Tensor, shape (...) Angles in radians. Magnitudes will be in the range :math:`[0, \pi]`. """ - return rotation_quaternion_magnitude( - euler_angle_to_rotation_quaternion( + return quaternion_magnitude( + euler_angle_to_quaternion( input, axes, degrees, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_euler_angle_to_rotation_quaternion.py b/src/beignet/ops/_geometry/_transformations/_rotations/_euler_angle_to_quaternion.py similarity index 99% rename from src/beignet/ops/_geometry/_transformations/_rotations/_euler_angle_to_rotation_quaternion.py rename to src/beignet/ops/_geometry/_transformations/_rotations/_euler_angle_to_quaternion.py index 76cb5d3729..7736d8171b 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_euler_angle_to_rotation_quaternion.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_euler_angle_to_quaternion.py @@ -4,7 +4,7 @@ from torch import Tensor -def euler_angle_to_rotation_quaternion( +def euler_angle_to_quaternion( input: Tensor, axes: str, degrees: bool = False, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_invert_euler_angle.py b/src/beignet/ops/_geometry/_transformations/_rotations/_invert_euler_angle.py index f70c17406e..9a7c3c6a6d 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_invert_euler_angle.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_invert_euler_angle.py @@ -1,11 +1,11 @@ from torch import Tensor -from ._euler_angle_to_rotation_quaternion import ( - euler_angle_to_rotation_quaternion, +from ._euler_angle_to_quaternion import ( + euler_angle_to_quaternion, ) -from ._invert_rotation_quaternion import invert_rotation_quaternion -from ._rotation_quaternion_to_euler_angle import ( - rotation_quaternion_to_euler_angle, +from ._invert_quaternion import invert_quaternion +from ._quaternion_to_euler_angle import ( + quaternion_to_euler_angle, ) @@ -35,9 +35,9 @@ def invert_euler_angle( inverted_euler_angles : Tensor, shape (..., 3) Inverted Euler angles. """ - return rotation_quaternion_to_euler_angle( - invert_rotation_quaternion( - euler_angle_to_rotation_quaternion( + return quaternion_to_euler_angle( + invert_quaternion( + euler_angle_to_quaternion( input, axes, degrees, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_invert_rotation_quaternion.py b/src/beignet/ops/_geometry/_transformations/_rotations/_invert_quaternion.py similarity index 90% rename from src/beignet/ops/_geometry/_transformations/_rotations/_invert_rotation_quaternion.py rename to src/beignet/ops/_geometry/_transformations/_rotations/_invert_quaternion.py index ca8dd020ac..9762327f75 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_invert_rotation_quaternion.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_invert_quaternion.py @@ -1,7 +1,7 @@ from torch import Tensor -def invert_rotation_quaternion( +def invert_quaternion( input: Tensor, canonical: bool = False, ) -> Tensor: @@ -23,7 +23,7 @@ def invert_rotation_quaternion( Returns ------- - inverted_rotation_quaternions : Tensor, shape (..., 4) + inverted_quaternions : Tensor, shape (..., 4) Inverted rotation quaternions. """ input[:, :3] = -input[:, :3] diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_mean_rotation_quaternion.py b/src/beignet/ops/_geometry/_transformations/_rotations/_mean_quaternion.py similarity index 97% rename from src/beignet/ops/_geometry/_transformations/_rotations/_mean_rotation_quaternion.py rename to src/beignet/ops/_geometry/_transformations/_rotations/_mean_quaternion.py index f1a4479896..15057ee5b4 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_mean_rotation_quaternion.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_mean_quaternion.py @@ -2,7 +2,7 @@ from torch import Tensor -def mean_rotation_quaternion( +def mean_quaternion( input: Tensor, weight: Tensor | None = None, canonical: bool = False, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_identity.py b/src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_identity.py similarity index 94% rename from src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_identity.py rename to src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_identity.py index 6286bfa62d..9474cb9669 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_identity.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_identity.py @@ -2,7 +2,7 @@ from torch import Tensor -def rotation_quaternion_identity( +def quaternion_identity( size: int, canonical: bool | None = False, *, @@ -47,7 +47,7 @@ def rotation_quaternion_identity( Returns ------- - identity_rotation_quaternions : Tensor, shape (size, 4) + identity_quaternions : Tensor, shape (size, 4) Identity rotation quaternions. """ rotation = torch.zeros( diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_magnitude.py b/src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_magnitude.py similarity index 90% rename from src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_magnitude.py rename to src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_magnitude.py index ac700212e1..7d2179c094 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_magnitude.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_magnitude.py @@ -2,7 +2,7 @@ from torch import Tensor -def rotation_quaternion_magnitude(input: Tensor, canonical=False) -> Tensor: +def quaternion_magnitude(input: Tensor, canonical=False) -> Tensor: r""" Rotation quaternion magnitudes. diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_to_euler_angle.py b/src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_to_euler_angle.py similarity index 98% rename from src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_to_euler_angle.py rename to src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_to_euler_angle.py index 770ef60ec8..e66d7a6459 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_to_euler_angle.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_to_euler_angle.py @@ -5,7 +5,7 @@ from torch import Tensor -def rotation_quaternion_to_euler_angle( +def quaternion_to_euler_angle( input: Tensor, axes: str, degrees: bool = False, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_to_rotation_matrix.py b/src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_to_rotation_matrix.py similarity index 94% rename from src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_to_rotation_matrix.py rename to src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_to_rotation_matrix.py index 9fbb2aa158..20d753af6b 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_to_rotation_matrix.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_to_rotation_matrix.py @@ -2,7 +2,7 @@ from torch import Tensor -def rotation_quaternion_to_rotation_matrix(input: Tensor) -> Tensor: +def quaternion_to_rotation_matrix(input: Tensor) -> Tensor: r""" Convert rotation quaternions to rotation matrices. diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_to_rotation_vector.py b/src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_to_rotation_vector.py similarity index 96% rename from src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_to_rotation_vector.py rename to src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_to_rotation_vector.py index 143b12d284..6827c672e8 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_quaternion_to_rotation_vector.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_quaternion_to_rotation_vector.py @@ -2,7 +2,7 @@ from torch import Tensor -def rotation_quaternion_to_rotation_vector( +def quaternion_to_rotation_vector( input: Tensor, degrees: bool | None = False, ) -> Tensor: diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_random_euler_angle.py b/src/beignet/ops/_geometry/_transformations/_rotations/_random_euler_angle.py index 1ea287b8df..8bb7106ca5 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_random_euler_angle.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_random_euler_angle.py @@ -1,9 +1,9 @@ import torch from torch import Generator, Tensor -from ._random_rotation_quaternion import random_rotation_quaternion -from ._rotation_quaternion_to_euler_angle import ( - rotation_quaternion_to_euler_angle, +from ._random_quaternion import random_quaternion +from ._quaternion_to_euler_angle import ( + quaternion_to_euler_angle, ) @@ -75,8 +75,8 @@ def random_euler_angle( the same (e.g., :math:`zxz`) * Third angle: :math:`[-180, 180]` degrees (inclusive) """ - return rotation_quaternion_to_euler_angle( - random_rotation_quaternion( + return quaternion_to_euler_angle( + random_quaternion( size, generator=generator, out=out, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_random_rotation_quaternion.py b/src/beignet/ops/_geometry/_transformations/_rotations/_random_quaternion.py similarity index 66% rename from src/beignet/ops/_geometry/_transformations/_rotations/_random_rotation_quaternion.py rename to src/beignet/ops/_geometry/_transformations/_rotations/_random_quaternion.py index a90e053ceb..468e4c3e8e 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_random_rotation_quaternion.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_random_quaternion.py @@ -2,7 +2,7 @@ from torch import Generator, Tensor -def random_rotation_quaternion( +def random_quaternion( size: int, canonical: bool = False, *, @@ -56,10 +56,10 @@ def random_rotation_quaternion( Returns ------- - random_rotation_quaternions : Tensor, shape (..., 4) + random_quaternions : Tensor, shape (..., 4) Random rotation quaternions. """ - rotation_quaternions = torch.rand( + quaternions = torch.rand( [size, 4], generator=generator, out=out, @@ -71,28 +71,25 @@ def random_rotation_quaternion( ) if canonical: - for index in range(rotation_quaternions.size(0)): + for index in range(quaternions.size(0)): if ( - (rotation_quaternions[index][3] < 0) + (quaternions[index][3] < 0) + or (quaternions[index][3] == 0 and quaternions[index][0] < 0) or ( - rotation_quaternions[index][3] == 0 - and rotation_quaternions[index][0] < 0 + quaternions[index][3] == 0 + and quaternions[index][0] == 0 + and quaternions[index][1] < 0 ) or ( - rotation_quaternions[index][3] == 0 - and rotation_quaternions[index][0] == 0 - and rotation_quaternions[index][1] < 0 - ) - or ( - rotation_quaternions[index][3] == 0 - and rotation_quaternions[index][0] == 0 - and rotation_quaternions[index][1] == 0 - and rotation_quaternions[index][2] < 0 + quaternions[index][3] == 0 + and quaternions[index][0] == 0 + and quaternions[index][1] == 0 + and quaternions[index][2] < 0 ) ): - rotation_quaternions[index][0] *= -1.0 - rotation_quaternions[index][1] *= -1.0 - rotation_quaternions[index][2] *= -1.0 - rotation_quaternions[index][3] *= -1.0 + quaternions[index][0] *= -1.0 + quaternions[index][1] *= -1.0 + quaternions[index][2] *= -1.0 + quaternions[index][3] *= -1.0 - return rotation_quaternions + return quaternions diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_random_rotation_matrix.py b/src/beignet/ops/_geometry/_transformations/_rotations/_random_rotation_matrix.py index d7dec8237a..fd222d09bd 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_random_rotation_matrix.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_random_rotation_matrix.py @@ -1,9 +1,9 @@ import torch from torch import Generator, Tensor -from ._random_rotation_quaternion import random_rotation_quaternion -from ._rotation_quaternion_to_rotation_matrix import ( - rotation_quaternion_to_rotation_matrix, +from ._random_quaternion import random_quaternion +from ._quaternion_to_rotation_matrix import ( + quaternion_to_rotation_matrix, ) @@ -55,8 +55,8 @@ def random_rotation_matrix( random_rotation_matrices : Tensor, shape (..., 3, 3) Random rotation matrices. """ - return rotation_quaternion_to_rotation_matrix( - random_rotation_quaternion( + return quaternion_to_rotation_matrix( + random_quaternion( size, generator=generator, out=out, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_random_rotation_vector.py b/src/beignet/ops/_geometry/_transformations/_rotations/_random_rotation_vector.py index 913d5604de..c18aff9feb 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_random_rotation_vector.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_random_rotation_vector.py @@ -1,9 +1,9 @@ import torch from torch import Generator, Tensor -from ._random_rotation_quaternion import random_rotation_quaternion -from ._rotation_quaternion_to_rotation_vector import ( - rotation_quaternion_to_rotation_vector, +from ._random_quaternion import random_quaternion +from ._quaternion_to_rotation_vector import ( + quaternion_to_rotation_vector, ) @@ -58,8 +58,8 @@ def random_rotation_vector( random_rotation_vectors : Tensor, shape (..., 3) Random rotation vectors. """ - return rotation_quaternion_to_rotation_vector( - random_rotation_quaternion( + return quaternion_to_rotation_vector( + random_quaternion( size, generator=generator, out=out, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_identity.py b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_identity.py index dab20dbcd4..4e646a5d85 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_identity.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_identity.py @@ -1,9 +1,9 @@ import torch from torch import Tensor -from ._rotation_quaternion_identity import rotation_quaternion_identity -from ._rotation_quaternion_to_rotation_matrix import ( - rotation_quaternion_to_rotation_matrix, +from ._quaternion_identity import quaternion_identity +from ._quaternion_to_rotation_matrix import ( + quaternion_to_rotation_matrix, ) @@ -46,8 +46,8 @@ def rotation_matrix_identity( identity_rotation_matrices : Tensor, shape (size, 3, 3) Identity rotation matrices. """ - return rotation_quaternion_to_rotation_matrix( - rotation_quaternion_identity( + return quaternion_to_rotation_matrix( + quaternion_identity( size, out=out, dtype=dtype, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_magnitude.py b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_magnitude.py index 92ddb91ee0..d02a9eefaa 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_magnitude.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_magnitude.py @@ -1,9 +1,9 @@ from torch import Tensor -from ._rotation_matrix_to_rotation_quaternion import ( - rotation_matrix_to_rotation_quaternion, +from ._rotation_matrix_to_quaternion import ( + rotation_matrix_to_quaternion, ) -from ._rotation_quaternion_magnitude import rotation_quaternion_magnitude +from ._quaternion_magnitude import quaternion_magnitude def rotation_matrix_magnitude(input: Tensor) -> Tensor: @@ -20,8 +20,8 @@ def rotation_matrix_magnitude(input: Tensor) -> Tensor: rotation_matrix_magnitudes: Tensor, shape (...) Angles in radians. Magnitudes will be in the range :math:`[0, \pi]`. """ - return rotation_quaternion_magnitude( - rotation_matrix_to_rotation_quaternion( + return quaternion_magnitude( + rotation_matrix_to_quaternion( input, ), ) diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_to_euler_angle.py b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_to_euler_angle.py index 69bd57c5ce..0f2a5936e5 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_to_euler_angle.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_to_euler_angle.py @@ -1,10 +1,10 @@ from torch import Tensor -from ._rotation_matrix_to_rotation_quaternion import ( - rotation_matrix_to_rotation_quaternion, +from ._rotation_matrix_to_quaternion import ( + rotation_matrix_to_quaternion, ) -from ._rotation_quaternion_to_euler_angle import ( - rotation_quaternion_to_euler_angle, +from ._quaternion_to_euler_angle import ( + quaternion_to_euler_angle, ) @@ -42,8 +42,8 @@ def rotation_matrix_to_euler_angle( (e.g., :math:`zxz`) * Third angle: :math:`[-180, 180]` degrees (inclusive) """ - return rotation_quaternion_to_euler_angle( - rotation_matrix_to_rotation_quaternion( + return quaternion_to_euler_angle( + rotation_matrix_to_quaternion( input, ), axes, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_to_rotation_quaternion.py b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_to_quaternion.py similarity index 98% rename from src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_to_rotation_quaternion.py rename to src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_to_quaternion.py index fbe6262bed..c415a6f888 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_to_rotation_quaternion.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_to_quaternion.py @@ -2,7 +2,7 @@ from torch import Tensor -def rotation_matrix_to_rotation_quaternion( +def rotation_matrix_to_quaternion( input: Tensor, canonical: bool | None = False, ) -> Tensor: diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_to_rotation_vector.py b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_to_rotation_vector.py index b4ebf3d923..b3ad9257b9 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_to_rotation_vector.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_matrix_to_rotation_vector.py @@ -1,10 +1,10 @@ from torch import Tensor -from ._rotation_matrix_to_rotation_quaternion import ( - rotation_matrix_to_rotation_quaternion, +from ._rotation_matrix_to_quaternion import ( + rotation_matrix_to_quaternion, ) -from ._rotation_quaternion_to_rotation_vector import ( - rotation_quaternion_to_rotation_vector, +from ._quaternion_to_rotation_vector import ( + quaternion_to_rotation_vector, ) @@ -29,8 +29,8 @@ def rotation_matrix_to_rotation_vector( output : Tensor, shape=(..., 3) Rotation vectors. """ - return rotation_quaternion_to_rotation_vector( - rotation_matrix_to_rotation_quaternion( + return quaternion_to_rotation_vector( + rotation_matrix_to_quaternion( input, ), degrees, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_identity.py b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_identity.py index 918523c490..29a0d0ad38 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_identity.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_identity.py @@ -1,9 +1,9 @@ import torch from torch import Tensor -from ._rotation_quaternion_identity import rotation_quaternion_identity -from ._rotation_quaternion_to_rotation_vector import ( - rotation_quaternion_to_rotation_vector, +from ._quaternion_identity import quaternion_identity +from ._quaternion_to_rotation_vector import ( + quaternion_to_rotation_vector, ) @@ -51,8 +51,8 @@ def rotation_vector_identity( identity_rotation_vectors : Tensor, shape (size, 3) Identity rotation vectors. """ - return rotation_quaternion_to_rotation_vector( - rotation_quaternion_identity( + return quaternion_to_rotation_vector( + quaternion_identity( size, out=out, dtype=dtype, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_magnitude.py b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_magnitude.py index 34cff10570..ceb1725235 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_magnitude.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_magnitude.py @@ -1,8 +1,8 @@ from torch import Tensor -from ._rotation_quaternion_magnitude import rotation_quaternion_magnitude -from ._rotation_vector_to_rotation_quaternion import ( - rotation_vector_to_rotation_quaternion, +from ._quaternion_magnitude import quaternion_magnitude +from ._rotation_vector_to_quaternion import ( + rotation_vector_to_quaternion, ) @@ -26,8 +26,8 @@ def rotation_vector_magnitude( rotation_vector_magnitudes : Tensor, shape (...) Angles in radians. Magnitudes will be in the range :math:`[0, \pi]`. """ - return rotation_quaternion_magnitude( - rotation_vector_to_rotation_quaternion( + return quaternion_magnitude( + rotation_vector_to_quaternion( input, degrees, ), diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_to_euler_angle.py b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_to_euler_angle.py index a27f885cd4..8ae5503d5c 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_to_euler_angle.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_to_euler_angle.py @@ -1,10 +1,10 @@ from torch import Tensor -from ._rotation_quaternion_to_euler_angle import ( - rotation_quaternion_to_euler_angle, +from ._quaternion_to_euler_angle import ( + quaternion_to_euler_angle, ) -from ._rotation_vector_to_rotation_quaternion import ( - rotation_vector_to_rotation_quaternion, +from ._rotation_vector_to_quaternion import ( + rotation_vector_to_quaternion, ) @@ -38,8 +38,8 @@ def rotation_vector_to_euler_angle( (e.g., :math:`zxz`) * Third angle: :math:`[-180, 180]` degrees (inclusive) """ - return rotation_quaternion_to_euler_angle( - rotation_vector_to_rotation_quaternion( + return quaternion_to_euler_angle( + rotation_vector_to_quaternion( input, degrees, ), diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_to_rotation_quaternion.py b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_to_quaternion.py similarity index 97% rename from src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_to_rotation_quaternion.py rename to src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_to_quaternion.py index eb59470f48..92bd81b65a 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_to_rotation_quaternion.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_to_quaternion.py @@ -2,7 +2,7 @@ from torch import Tensor -def rotation_vector_to_rotation_quaternion( +def rotation_vector_to_quaternion( input: Tensor, degrees: bool | None = False, canonical: bool | None = False, diff --git a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_to_rotation_matrix.py b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_to_rotation_matrix.py index c76cb44488..9259f8b233 100644 --- a/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_to_rotation_matrix.py +++ b/src/beignet/ops/_geometry/_transformations/_rotations/_rotation_vector_to_rotation_matrix.py @@ -1,10 +1,10 @@ from torch import Tensor -from ._rotation_quaternion_to_rotation_matrix import ( - rotation_quaternion_to_rotation_matrix, +from ._quaternion_to_rotation_matrix import ( + quaternion_to_rotation_matrix, ) -from ._rotation_vector_to_rotation_quaternion import ( - rotation_vector_to_rotation_quaternion, +from ._rotation_vector_to_quaternion import ( + rotation_vector_to_quaternion, ) @@ -29,8 +29,8 @@ def rotation_vector_to_rotation_matrix( output : Tensor, shape=(..., 3, 3) Rotation matrices. """ - return rotation_quaternion_to_rotation_matrix( - rotation_vector_to_rotation_quaternion( + return quaternion_to_rotation_matrix( + rotation_vector_to_quaternion( input, degrees, ), diff --git a/tests/beignet/ops/_geometry/_transformations/_rotations/test__apply_rotation_quaternion.py b/tests/beignet/ops/_geometry/_transformations/_rotations/test__apply_quaternion.py similarity index 92% rename from tests/beignet/ops/_geometry/_transformations/_rotations/test__apply_rotation_quaternion.py rename to tests/beignet/ops/_geometry/_transformations/_rotations/test__apply_quaternion.py index aa22598cf4..d395037426 100644 --- a/tests/beignet/ops/_geometry/_transformations/_rotations/test__apply_rotation_quaternion.py +++ b/tests/beignet/ops/_geometry/_transformations/_rotations/test__apply_quaternion.py @@ -44,10 +44,10 @@ def _strategy(function): @hypothesis.given(_strategy()) -def test_apply_rotation_quaternion(data): +def test_apply_quaternion(data): parameters, expected = data torch.testing.assert_close( - beignet.ops.apply_rotation_quaternion(**parameters), + beignet.ops.apply_quaternion(**parameters), expected, ) diff --git a/tests/beignet/ops/_geometry/_transformations/_rotations/test__compose_rotation_quaternion.py b/tests/beignet/ops/_geometry/_transformations/_rotations/test__compose_quaternion.py similarity index 92% rename from tests/beignet/ops/_geometry/_transformations/_rotations/test__compose_rotation_quaternion.py rename to tests/beignet/ops/_geometry/_transformations/_rotations/test__compose_quaternion.py index b6289fdff5..afa7104603 100644 --- a/tests/beignet/ops/_geometry/_transformations/_rotations/test__compose_rotation_quaternion.py +++ b/tests/beignet/ops/_geometry/_transformations/_rotations/test__compose_quaternion.py @@ -45,12 +45,12 @@ def _strategy(function): @hypothesis.given(_strategy()) -def test_compose_rotation_quaternion(data): +def test_compose_quaternion(data): parameters, expected = data torch.testing.assert_close( torch.abs( - beignet.ops.compose_rotation_quaternion( + beignet.ops.compose_quaternion( **parameters, ), ), diff --git a/tests/beignet/ops/_geometry/_transformations/_rotations/test__euler_angle_to_rotation_quaternion.py b/tests/beignet/ops/_geometry/_transformations/_rotations/test__euler_angle_to_quaternion.py similarity index 93% rename from tests/beignet/ops/_geometry/_transformations/_rotations/test__euler_angle_to_rotation_quaternion.py rename to tests/beignet/ops/_geometry/_transformations/_rotations/test__euler_angle_to_quaternion.py index 363aea6403..825249c895 100644 --- a/tests/beignet/ops/_geometry/_transformations/_rotations/test__euler_angle_to_rotation_quaternion.py +++ b/tests/beignet/ops/_geometry/_transformations/_rotations/test__euler_angle_to_quaternion.py @@ -62,12 +62,12 @@ def _strategy(function): @hypothesis.given(_strategy()) -def test_euler_angle_to_rotation_quaternion(data): +def test_euler_angle_to_quaternion(data): parameters, expected = data torch.testing.assert_close( torch.abs( - beignet.ops.euler_angle_to_rotation_quaternion( + beignet.ops.euler_angle_to_quaternion( **parameters, ), ), diff --git a/tests/beignet/ops/_geometry/_transformations/_rotations/test__invert_rotation_quaternion.py b/tests/beignet/ops/_geometry/_transformations/_rotations/test__invert_quaternion.py similarity index 87% rename from tests/beignet/ops/_geometry/_transformations/_rotations/test__invert_rotation_quaternion.py rename to tests/beignet/ops/_geometry/_transformations/_rotations/test__invert_quaternion.py index a39272f5e0..af857a4132 100644 --- a/tests/beignet/ops/_geometry/_transformations/_rotations/test__invert_rotation_quaternion.py +++ b/tests/beignet/ops/_geometry/_transformations/_rotations/test__invert_quaternion.py @@ -27,10 +27,10 @@ def _strategy(function): @hypothesis.given(_strategy()) -def test_invert_rotation_quaternion(data): +def test_invert_quaternion(data): parameters, expected = data torch.testing.assert_close( - beignet.ops.invert_rotation_quaternion(**parameters), + beignet.ops.invert_quaternion(**parameters), expected, ) diff --git a/tests/beignet/ops/_geometry/_transformations/_rotations/test__mean_rotation_quaternion.py b/tests/beignet/ops/_geometry/_transformations/_rotations/test__mean_quaternion.py similarity index 91% rename from tests/beignet/ops/_geometry/_transformations/_rotations/test__mean_rotation_quaternion.py rename to tests/beignet/ops/_geometry/_transformations/_rotations/test__mean_quaternion.py index 1f383ca814..98e4bd2d1f 100644 --- a/tests/beignet/ops/_geometry/_transformations/_rotations/test__mean_rotation_quaternion.py +++ b/tests/beignet/ops/_geometry/_transformations/_rotations/test__mean_quaternion.py @@ -39,12 +39,12 @@ def _strategy(function): @hypothesis.given(_strategy()) -def test_mean_rotation_quaternion(data): +def test_mean_quaternion(data): parameters, expected = data torch.testing.assert_close( torch.abs( - beignet.ops.mean_rotation_quaternion( + beignet.ops.mean_quaternion( **parameters, ), ), diff --git a/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_identity.py b/tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_identity.py similarity index 86% rename from tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_identity.py rename to tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_identity.py index ada94c5e5e..5c20cecc00 100644 --- a/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_identity.py +++ b/tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_identity.py @@ -28,10 +28,10 @@ def _strategy(function): @hypothesis.given(_strategy()) -def test_rotation_quaternion_identity(data): +def test_quaternion_identity(data): parameters, expected = data torch.testing.assert_close( - beignet.ops.rotation_quaternion_identity(**parameters), + beignet.ops.quaternion_identity(**parameters), expected, ) diff --git a/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_magnitude.py b/tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_magnitude.py similarity index 86% rename from tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_magnitude.py rename to tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_magnitude.py index dda353fde0..39461c0eb8 100644 --- a/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_magnitude.py +++ b/tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_magnitude.py @@ -27,10 +27,10 @@ def _strategy(function): @hypothesis.given(_strategy()) -def test_rotation_quaternion_magnitude(data): +def test_quaternion_magnitude(data): parameters, expected = data torch.testing.assert_close( - beignet.ops.rotation_quaternion_magnitude(**parameters), + beignet.ops.quaternion_magnitude(**parameters), expected, ) diff --git a/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_to_euler_angle.py b/tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_to_euler_angle.py similarity index 92% rename from tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_to_euler_angle.py rename to tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_to_euler_angle.py index e59da6047f..8f38a8aa39 100644 --- a/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_to_euler_angle.py +++ b/tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_to_euler_angle.py @@ -56,11 +56,11 @@ def _strategy(function): @hypothesis.given(_strategy()) -def test_rotation_quaternion_to_euler_angle(data): +def test_quaternion_to_euler_angle(data): parameters, expected = data torch.testing.assert_close( - beignet.ops.rotation_quaternion_to_euler_angle( + beignet.ops.quaternion_to_euler_angle( **parameters, ), expected, diff --git a/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_to_rotation_matrix.py b/tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_to_rotation_matrix.py similarity index 86% rename from tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_to_rotation_matrix.py rename to tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_to_rotation_matrix.py index d8d75d934e..653d5847eb 100644 --- a/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_to_rotation_matrix.py +++ b/tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_to_rotation_matrix.py @@ -30,11 +30,11 @@ def _strategy(function): @hypothesis.given(_strategy()) -def test_rotation_quaternion_to_rotation_matrix(data): +def test_quaternion_to_rotation_matrix(data): parameters, expected = data torch.testing.assert_close( - beignet.ops.rotation_quaternion_to_rotation_matrix( + beignet.ops.quaternion_to_rotation_matrix( **parameters, ), expected, diff --git a/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_to_rotation_vector.py b/tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_to_rotation_vector.py similarity index 88% rename from tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_to_rotation_vector.py rename to tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_to_rotation_vector.py index 423c185e24..156db33763 100644 --- a/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_quaternion_to_rotation_vector.py +++ b/tests/beignet/ops/_geometry/_transformations/_rotations/test__quaternion_to_rotation_vector.py @@ -35,11 +35,11 @@ def _strategy(function): @hypothesis.given(_strategy()) -def test_rotation_quaternion_to_rotation_vector(data): +def test_quaternion_to_rotation_vector(data): parameters, expected = data torch.testing.assert_close( - beignet.ops.rotation_quaternion_to_rotation_vector( + beignet.ops.quaternion_to_rotation_vector( **parameters, ), expected, diff --git a/tests/beignet/ops/_geometry/_transformations/_rotations/test__random_rotation_quaternion.py b/tests/beignet/ops/_geometry/_transformations/_rotations/test__random_quaternion.py similarity index 85% rename from tests/beignet/ops/_geometry/_transformations/_rotations/test__random_rotation_quaternion.py rename to tests/beignet/ops/_geometry/_transformations/_rotations/test__random_quaternion.py index 48f8ea24e6..2d0472a3f0 100644 --- a/tests/beignet/ops/_geometry/_transformations/_rotations/test__random_rotation_quaternion.py +++ b/tests/beignet/ops/_geometry/_transformations/_rotations/test__random_quaternion.py @@ -23,9 +23,9 @@ def _strategy(function): @hypothesis.given(_strategy()) -def test_random_rotation_quaternion(data): +def test_random_quaternion(data): parameters, _ = data - assert beignet.ops.random_rotation_quaternion( + assert beignet.ops.random_quaternion( **parameters, ).shape == (parameters["size"], 4) diff --git a/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_matrix_to_rotation_quaternion.py b/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_matrix_to_quaternion.py similarity index 89% rename from tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_matrix_to_rotation_quaternion.py rename to tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_matrix_to_quaternion.py index bb5f5bd788..b5cf1e5eeb 100644 --- a/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_matrix_to_rotation_quaternion.py +++ b/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_matrix_to_quaternion.py @@ -36,12 +36,12 @@ def _strategy(function): @hypothesis.given(_strategy()) -def test_rotation_matrix_to_rotation_quaternion(data): +def test_rotation_matrix_to_quaternion(data): parameters, expected = data torch.testing.assert_close( torch.abs( - beignet.ops.rotation_matrix_to_rotation_quaternion( + beignet.ops.rotation_matrix_to_quaternion( **parameters, ), ), diff --git a/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_vector_to_rotation_quaternion.py b/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_vector_to_quaternion.py similarity index 90% rename from tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_vector_to_rotation_quaternion.py rename to tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_vector_to_quaternion.py index 797aa51191..294ac1450e 100644 --- a/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_vector_to_rotation_quaternion.py +++ b/tests/beignet/ops/_geometry/_transformations/_rotations/test__rotation_vector_to_quaternion.py @@ -41,12 +41,12 @@ def _strategy(function): @hypothesis.given(_strategy()) -def test_rotation_vector_to_rotation_quaternion(data): +def test_rotation_vector_to_quaternion(data): parameters, expected = data torch.testing.assert_close( torch.abs( - beignet.ops.rotation_vector_to_rotation_quaternion( + beignet.ops.rotation_vector_to_quaternion( **parameters, ), ),