From 10b47f575af85dc2e5fc3a030f770a793dc4becf Mon Sep 17 00:00:00 2001 From: Yixing Lao Date: Mon, 14 Oct 2024 02:39:32 +0800 Subject: [PATCH] refactor(camtools): change array dimension notation from uppercase 'N' to lowercase 'n' for consistency and clarity --- camtools/project.py | 6 +++--- camtools/solver.py | 4 ++-- test/test_backend.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/camtools/project.py b/camtools/project.py index 4055c5a..1559fa4 100644 --- a/camtools/project.py +++ b/camtools/project.py @@ -11,7 +11,7 @@ def points_to_pixels( - points: Float[np.ndarray, "N 3"], + points: Float[np.ndarray, "n 3"], K: Float[np.ndarray, "3 3"], T: Float[np.ndarray, "4 4"], ) -> Float[np.ndarray, "N 2"]: @@ -67,9 +67,9 @@ def im_depth_to_point_cloud( ignore_invalid: bool = True, scale_factor: float = 1.0, ) -> Union[ - Float[np.ndarray, "N 3"], + Float[np.ndarray, "n 3"], Float[np.ndarray, "h w 3"], - Tuple[Float[np.ndarray, "N 3"], Float[np.ndarray, "N 3"]], + Tuple[Float[np.ndarray, "n 3"], Float[np.ndarray, "n 3"]], Tuple[Float[np.ndarray, "h w 3"], Float[np.ndarray, "h w 3"]], ]: """ diff --git a/camtools/solver.py b/camtools/solver.py index 1cfdd4c..510e176 100644 --- a/camtools/solver.py +++ b/camtools/solver.py @@ -178,9 +178,9 @@ def point_plane_distance_three_points(point, plane_points): def points_to_mesh_distances( - points: Float[np.ndarray, "N 3"], + points: Float[np.ndarray, "n 3"], mesh: o3d.geometry.TriangleMesh, -) -> Float[np.ndarray, "N"]: +) -> Float[np.ndarray, "n"]: """ Compute the distance from points to a mesh surface. diff --git a/test/test_backend.py b/test/test_backend.py index e76bd43..07dd34f 100644 --- a/test/test_backend.py +++ b/test/test_backend.py @@ -513,8 +513,8 @@ def test_union_of_hints(): def identity( arr: Union[ Float[Tensor, "3 4"], - Float[Tensor, "N 3 4"], - Int[Tensor, "N 3 4"], + Float[Tensor, "n 3 4"], + Int[Tensor, "n 3 4"], ] ): return arr