From ee77f27024f74d9bc74c44c4c4e2e8cdd4b868b5 Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 25 May 2023 04:12:11 +0000 Subject: [PATCH] [SymForce] Fix returns in docstrings To all use the "Returns" syntax, which we've marked as a params_style block Topic: sf-docs-returns Relative: sf-docs-furo GitOrigin-RevId: a04b6df061e131c9640b202bde5a76409be41e51 --- gen/cpp/sym/atan_camera_cal.h | 4 ++-- gen/cpp/sym/camera.h | 4 ++-- gen/cpp/sym/double_sphere_camera_cal.h | 4 ++-- gen/cpp/sym/equirectangular_camera_cal.h | 4 ++-- gen/cpp/sym/linear_camera_cal.h | 4 ++-- gen/cpp/sym/polynomial_camera_cal.h | 2 +- gen/cpp/sym/posed_camera.h | 6 +++--- gen/cpp/sym/spherical_camera_cal.h | 2 +- gen/python/sym/atan_camera_cal.py | 4 ++-- gen/python/sym/double_sphere_camera_cal.py | 4 ++-- gen/python/sym/equirectangular_camera_cal.py | 4 ++-- gen/python/sym/linear_camera_cal.py | 4 ++-- gen/python/sym/ops/atan_camera_cal/camera_ops.py | 4 ++-- gen/python/sym/ops/double_sphere_camera_cal/camera_ops.py | 4 ++-- gen/python/sym/ops/equirectangular_camera_cal/camera_ops.py | 4 ++-- gen/python/sym/ops/linear_camera_cal/camera_ops.py | 4 ++-- gen/python/sym/ops/polynomial_camera_cal/camera_ops.py | 2 +- gen/python/sym/ops/spherical_camera_cal/camera_ops.py | 2 +- gen/python/sym/polynomial_camera_cal.py | 2 +- gen/python/sym/spherical_camera_cal.py | 2 +- symforce/__init__.py | 3 --- symforce/cam/camera.py | 4 ++-- symforce/cam/posed_camera.py | 6 +++--- symforce/codegen/cam_package_codegen.py | 4 ++-- 24 files changed, 42 insertions(+), 45 deletions(-) diff --git a/gen/cpp/sym/atan_camera_cal.h b/gen/cpp/sym/atan_camera_cal.h index 5a2d4cf66..feb0fa976 100644 --- a/gen/cpp/sym/atan_camera_cal.h +++ b/gen/cpp/sym/atan_camera_cal.h @@ -95,7 +95,7 @@ class ATANCameraCal { /** * Project a 3D point in the camera frame into 2D pixel coordinates. * - * Return: + * Returns: * pixel: (x, y) coordinate in pixels if valid * is_valid: 1 if the operation is within bounds else 0 * pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters @@ -120,7 +120,7 @@ class ATANCameraCal { /** * Backproject a 2D pixel coordinate into a 3D ray in the camera frame. * - * Return: + * Returns: * camera_ray: The ray in the camera frame (NOT normalized) * is_valid: 1 if the operation is within bounds else 0 * point_D_cal: Derivative of point with respect to intrinsic calibration parameters diff --git a/gen/cpp/sym/camera.h b/gen/cpp/sym/camera.h index d802aa1ac..b41552ece 100644 --- a/gen/cpp/sym/camera.h +++ b/gen/cpp/sym/camera.h @@ -36,7 +36,7 @@ class Camera { /** * Project a 3D point in the camera frame into 2D pixel coordinates. * - * Return: + * Returns: * pixel: (x, y) coordinate in pixels if valid * is_valid: 1 if the operation is within bounds (including image_size bounds) else 0 * @@ -61,7 +61,7 @@ class Camera { * Args: * normalize: Whether camera_ray will be normalized (False by default) * - * Return: + * Returns: * camera_ray: The ray in the camera frame * is_valid: 1 if the operation is within bounds else 0 * diff --git a/gen/cpp/sym/double_sphere_camera_cal.h b/gen/cpp/sym/double_sphere_camera_cal.h index 00924858b..6d4b88240 100644 --- a/gen/cpp/sym/double_sphere_camera_cal.h +++ b/gen/cpp/sym/double_sphere_camera_cal.h @@ -109,7 +109,7 @@ class DoubleSphereCameraCal { /** * Project a 3D point in the camera frame into 2D pixel coordinates. * - * Return: + * Returns: * pixel: (x, y) coordinate in pixels if valid * is_valid: 1 if the operation is within bounds else 0 * pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters @@ -134,7 +134,7 @@ class DoubleSphereCameraCal { /** * Backproject a 2D pixel coordinate into a 3D ray in the camera frame. * - * Return: + * Returns: * camera_ray: The ray in the camera frame (NOT normalized) * is_valid: 1 if the operation is within bounds else 0 * point_D_cal: Derivative of point with respect to intrinsic calibration parameters diff --git a/gen/cpp/sym/equirectangular_camera_cal.h b/gen/cpp/sym/equirectangular_camera_cal.h index 3b65bb3af..ffab1ce37 100644 --- a/gen/cpp/sym/equirectangular_camera_cal.h +++ b/gen/cpp/sym/equirectangular_camera_cal.h @@ -92,7 +92,7 @@ class EquirectangularCameraCal { /** * Project a 3D point in the camera frame into 2D pixel coordinates. * - * Return: + * Returns: * pixel: (x, y) coordinate in pixels if valid * is_valid: 1 if the operation is within bounds else 0 * pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters @@ -117,7 +117,7 @@ class EquirectangularCameraCal { /** * Backproject a 2D pixel coordinate into a 3D ray in the camera frame. * - * Return: + * Returns: * camera_ray: The ray in the camera frame (NOT normalized) * is_valid: 1 if the operation is within bounds else 0 * point_D_cal: Derivative of point with respect to intrinsic calibration parameters diff --git a/gen/cpp/sym/linear_camera_cal.h b/gen/cpp/sym/linear_camera_cal.h index e57a504e7..6b5174521 100644 --- a/gen/cpp/sym/linear_camera_cal.h +++ b/gen/cpp/sym/linear_camera_cal.h @@ -91,7 +91,7 @@ class LinearCameraCal { /** * Project a 3D point in the camera frame into 2D pixel coordinates. * - * Return: + * Returns: * pixel: (x, y) coordinate in pixels if valid * is_valid: 1 if the operation is within bounds else 0 * pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters @@ -116,7 +116,7 @@ class LinearCameraCal { /** * Backproject a 2D pixel coordinate into a 3D ray in the camera frame. * - * Return: + * Returns: * camera_ray: The ray in the camera frame (NOT normalized) * is_valid: 1 if the operation is within bounds else 0 * point_D_cal: Derivative of point with respect to intrinsic calibration parameters diff --git a/gen/cpp/sym/polynomial_camera_cal.h b/gen/cpp/sym/polynomial_camera_cal.h index e07cd517d..24c2c46c1 100644 --- a/gen/cpp/sym/polynomial_camera_cal.h +++ b/gen/cpp/sym/polynomial_camera_cal.h @@ -103,7 +103,7 @@ class PolynomialCameraCal { /** * Project a 3D point in the camera frame into 2D pixel coordinates. * - * Return: + * Returns: * pixel: (x, y) coordinate in pixels if valid * is_valid: 1 if the operation is within bounds else 0 * pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters diff --git a/gen/cpp/sym/posed_camera.h b/gen/cpp/sym/posed_camera.h index 7111f7ace..883a6cb24 100644 --- a/gen/cpp/sym/posed_camera.h +++ b/gen/cpp/sym/posed_camera.h @@ -37,7 +37,7 @@ class PosedCamera : public Camera { * point: Vector written in camera frame. * epsilon: Small value intended to prevent division by 0. * - * Return: + * Returns: * pixel: UV coodinates in pixel units, assuming the point is in view * is_valid: 1 if point is valid * @@ -60,7 +60,7 @@ class PosedCamera : public Camera { * range_to_point: Distance of the returned point along the ray passing through pixel * epsilon: Small value intended to prevent division by 0. * - * Return: + * Returns: * global_point: The point in the global frame. * is_valid: 1 if point is valid * @@ -83,7 +83,7 @@ class PosedCamera : public Camera { * inverse_range: Inverse distance along the ray to the global point * target_cam: Camera to project global point into * - * Return: + * Returns: * pixel: Pixel in the target camera * is_valid: 1 if given point is valid in source camera and target camera * diff --git a/gen/cpp/sym/spherical_camera_cal.h b/gen/cpp/sym/spherical_camera_cal.h index ed01f93ad..96b63ddf0 100644 --- a/gen/cpp/sym/spherical_camera_cal.h +++ b/gen/cpp/sym/spherical_camera_cal.h @@ -118,7 +118,7 @@ class SphericalCameraCal { /** * Project a 3D point in the camera frame into 2D pixel coordinates. * - * Return: + * Returns: * pixel: (x, y) coordinate in pixels if valid * is_valid: 1 if the operation is within bounds else 0 * pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters diff --git a/gen/python/sym/atan_camera_cal.py b/gen/python/sym/atan_camera_cal.py index b3181139f..90f8a915a 100644 --- a/gen/python/sym/atan_camera_cal.py +++ b/gen/python/sym/atan_camera_cal.py @@ -110,7 +110,7 @@ def pixel_from_camera_point_with_jacobians(self, point, epsilon): """ Project a 3D point in the camera frame into 2D pixel coordinates. - Return: + Returns: pixel: (x, y) coordinate in pixels if valid is_valid: 1 if the operation is within bounds else 0 pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters @@ -136,7 +136,7 @@ def camera_ray_from_pixel_with_jacobians(self, pixel, epsilon): """ Backproject a 2D pixel coordinate into a 3D ray in the camera frame. - Return: + Returns: camera_ray: The ray in the camera frame (NOT normalized) is_valid: 1 if the operation is within bounds else 0 point_D_cal: Derivative of point with respect to intrinsic calibration parameters diff --git a/gen/python/sym/double_sphere_camera_cal.py b/gen/python/sym/double_sphere_camera_cal.py index 99662aeb3..066563bf4 100644 --- a/gen/python/sym/double_sphere_camera_cal.py +++ b/gen/python/sym/double_sphere_camera_cal.py @@ -123,7 +123,7 @@ def pixel_from_camera_point_with_jacobians(self, point, epsilon): """ Project a 3D point in the camera frame into 2D pixel coordinates. - Return: + Returns: pixel: (x, y) coordinate in pixels if valid is_valid: 1 if the operation is within bounds else 0 pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters @@ -149,7 +149,7 @@ def camera_ray_from_pixel_with_jacobians(self, pixel, epsilon): """ Backproject a 2D pixel coordinate into a 3D ray in the camera frame. - Return: + Returns: camera_ray: The ray in the camera frame (NOT normalized) is_valid: 1 if the operation is within bounds else 0 point_D_cal: Derivative of point with respect to intrinsic calibration parameters diff --git a/gen/python/sym/equirectangular_camera_cal.py b/gen/python/sym/equirectangular_camera_cal.py index 111bb8d67..412086d2f 100644 --- a/gen/python/sym/equirectangular_camera_cal.py +++ b/gen/python/sym/equirectangular_camera_cal.py @@ -105,7 +105,7 @@ def pixel_from_camera_point_with_jacobians(self, point, epsilon): """ Project a 3D point in the camera frame into 2D pixel coordinates. - Return: + Returns: pixel: (x, y) coordinate in pixels if valid is_valid: 1 if the operation is within bounds else 0 pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters @@ -131,7 +131,7 @@ def camera_ray_from_pixel_with_jacobians(self, pixel, epsilon): """ Backproject a 2D pixel coordinate into a 3D ray in the camera frame. - Return: + Returns: camera_ray: The ray in the camera frame (NOT normalized) is_valid: 1 if the operation is within bounds else 0 point_D_cal: Derivative of point with respect to intrinsic calibration parameters diff --git a/gen/python/sym/linear_camera_cal.py b/gen/python/sym/linear_camera_cal.py index fa838e75b..1cefee792 100644 --- a/gen/python/sym/linear_camera_cal.py +++ b/gen/python/sym/linear_camera_cal.py @@ -105,7 +105,7 @@ def pixel_from_camera_point_with_jacobians(self, point, epsilon): """ Project a 3D point in the camera frame into 2D pixel coordinates. - Return: + Returns: pixel: (x, y) coordinate in pixels if valid is_valid: 1 if the operation is within bounds else 0 pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters @@ -131,7 +131,7 @@ def camera_ray_from_pixel_with_jacobians(self, pixel, epsilon): """ Backproject a 2D pixel coordinate into a 3D ray in the camera frame. - Return: + Returns: camera_ray: The ray in the camera frame (NOT normalized) is_valid: 1 if the operation is within bounds else 0 point_D_cal: Derivative of point with respect to intrinsic calibration parameters diff --git a/gen/python/sym/ops/atan_camera_cal/camera_ops.py b/gen/python/sym/ops/atan_camera_cal/camera_ops.py index f9df6fee0..0febe9e99 100644 --- a/gen/python/sym/ops/atan_camera_cal/camera_ops.py +++ b/gen/python/sym/ops/atan_camera_cal/camera_ops.py @@ -100,7 +100,7 @@ def pixel_from_camera_point_with_jacobians(self, point, epsilon): """ Project a 3D point in the camera frame into 2D pixel coordinates. - Return: + Returns: pixel: (x, y) coordinate in pixels if valid is_valid: 1 if the operation is within bounds else 0 pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters @@ -247,7 +247,7 @@ def camera_ray_from_pixel_with_jacobians(self, pixel, epsilon): """ Backproject a 2D pixel coordinate into a 3D ray in the camera frame. - Return: + Returns: camera_ray: The ray in the camera frame (NOT normalized) is_valid: 1 if the operation is within bounds else 0 point_D_cal: Derivative of point with respect to intrinsic calibration parameters diff --git a/gen/python/sym/ops/double_sphere_camera_cal/camera_ops.py b/gen/python/sym/ops/double_sphere_camera_cal/camera_ops.py index 860a1e04e..af0d7cb3c 100644 --- a/gen/python/sym/ops/double_sphere_camera_cal/camera_ops.py +++ b/gen/python/sym/ops/double_sphere_camera_cal/camera_ops.py @@ -153,7 +153,7 @@ def pixel_from_camera_point_with_jacobians(self, point, epsilon): """ Project a 3D point in the camera frame into 2D pixel coordinates. - Return: + Returns: pixel: (x, y) coordinate in pixels if valid is_valid: 1 if the operation is within bounds else 0 pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters @@ -339,7 +339,7 @@ def camera_ray_from_pixel_with_jacobians(self, pixel, epsilon): """ Backproject a 2D pixel coordinate into a 3D ray in the camera frame. - Return: + Returns: camera_ray: The ray in the camera frame (NOT normalized) is_valid: 1 if the operation is within bounds else 0 point_D_cal: Derivative of point with respect to intrinsic calibration parameters diff --git a/gen/python/sym/ops/equirectangular_camera_cal/camera_ops.py b/gen/python/sym/ops/equirectangular_camera_cal/camera_ops.py index b5bf7d08a..4c92cde06 100644 --- a/gen/python/sym/ops/equirectangular_camera_cal/camera_ops.py +++ b/gen/python/sym/ops/equirectangular_camera_cal/camera_ops.py @@ -108,7 +108,7 @@ def pixel_from_camera_point_with_jacobians(self, point, epsilon): """ Project a 3D point in the camera frame into 2D pixel coordinates. - Return: + Returns: pixel: (x, y) coordinate in pixels if valid is_valid: 1 if the operation is within bounds else 0 pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters @@ -219,7 +219,7 @@ def camera_ray_from_pixel_with_jacobians(self, pixel, epsilon): """ Backproject a 2D pixel coordinate into a 3D ray in the camera frame. - Return: + Returns: camera_ray: The ray in the camera frame (NOT normalized) is_valid: 1 if the operation is within bounds else 0 point_D_cal: Derivative of point with respect to intrinsic calibration parameters diff --git a/gen/python/sym/ops/linear_camera_cal/camera_ops.py b/gen/python/sym/ops/linear_camera_cal/camera_ops.py index ea32b003b..131deb845 100644 --- a/gen/python/sym/ops/linear_camera_cal/camera_ops.py +++ b/gen/python/sym/ops/linear_camera_cal/camera_ops.py @@ -97,7 +97,7 @@ def pixel_from_camera_point_with_jacobians(self, point, epsilon): """ Project a 3D point in the camera frame into 2D pixel coordinates. - Return: + Returns: pixel: (x, y) coordinate in pixels if valid is_valid: 1 if the operation is within bounds else 0 pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters @@ -194,7 +194,7 @@ def camera_ray_from_pixel_with_jacobians(self, pixel, epsilon): """ Backproject a 2D pixel coordinate into a 3D ray in the camera frame. - Return: + Returns: camera_ray: The ray in the camera frame (NOT normalized) is_valid: 1 if the operation is within bounds else 0 point_D_cal: Derivative of point with respect to intrinsic calibration parameters diff --git a/gen/python/sym/ops/polynomial_camera_cal/camera_ops.py b/gen/python/sym/ops/polynomial_camera_cal/camera_ops.py index f0562a36d..0d50960ae 100644 --- a/gen/python/sym/ops/polynomial_camera_cal/camera_ops.py +++ b/gen/python/sym/ops/polynomial_camera_cal/camera_ops.py @@ -112,7 +112,7 @@ def pixel_from_camera_point_with_jacobians(self, point, epsilon): """ Project a 3D point in the camera frame into 2D pixel coordinates. - Return: + Returns: pixel: (x, y) coordinate in pixels if valid is_valid: 1 if the operation is within bounds else 0 pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters diff --git a/gen/python/sym/ops/spherical_camera_cal/camera_ops.py b/gen/python/sym/ops/spherical_camera_cal/camera_ops.py index 978e48daf..774ee3e87 100644 --- a/gen/python/sym/ops/spherical_camera_cal/camera_ops.py +++ b/gen/python/sym/ops/spherical_camera_cal/camera_ops.py @@ -106,7 +106,7 @@ def pixel_from_camera_point_with_jacobians(self, point, epsilon): """ Project a 3D point in the camera frame into 2D pixel coordinates. - Return: + Returns: pixel: (x, y) coordinate in pixels if valid is_valid: 1 if the operation is within bounds else 0 pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters diff --git a/gen/python/sym/polynomial_camera_cal.py b/gen/python/sym/polynomial_camera_cal.py index eae3e81d0..d8de7ea43 100644 --- a/gen/python/sym/polynomial_camera_cal.py +++ b/gen/python/sym/polynomial_camera_cal.py @@ -133,7 +133,7 @@ def pixel_from_camera_point_with_jacobians(self, point, epsilon): """ Project a 3D point in the camera frame into 2D pixel coordinates. - Return: + Returns: pixel: (x, y) coordinate in pixels if valid is_valid: 1 if the operation is within bounds else 0 pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters diff --git a/gen/python/sym/spherical_camera_cal.py b/gen/python/sym/spherical_camera_cal.py index c01f38903..44e2ca9bf 100644 --- a/gen/python/sym/spherical_camera_cal.py +++ b/gen/python/sym/spherical_camera_cal.py @@ -148,7 +148,7 @@ def pixel_from_camera_point_with_jacobians(self, point, epsilon): """ Project a 3D point in the camera frame into 2D pixel coordinates. - Return: + Returns: pixel: (x, y) coordinate in pixels if valid is_valid: 1 if the operation is within bounds else 0 pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters diff --git a/symforce/__init__.py b/symforce/__init__.py index 334a73bf0..0eaf8de3c 100644 --- a/symforce/__init__.py +++ b/symforce/__init__.py @@ -220,9 +220,6 @@ def set_symbolic_api(name: str) -> None: def get_symbolic_api() -> str: """ Return the current symbolic API as a string. - - Returns: - str: """ assert _symbolic_api is not None return _symbolic_api diff --git a/symforce/cam/camera.py b/symforce/cam/camera.py index 760bd1d6e..4fb11e91c 100644 --- a/symforce/cam/camera.py +++ b/symforce/cam/camera.py @@ -57,7 +57,7 @@ def pixel_from_camera_point( """ Project a 3D point in the camera frame into 2D pixel coordinates. - Return: + Returns: pixel: (x, y) coordinate in pixels if valid is_valid: 1 if the operation is within bounds (including image_size bounds) else 0 """ @@ -77,7 +77,7 @@ def camera_ray_from_pixel( Args: normalize: Whether camera_ray will be normalized (False by default) - Return: + Returns: camera_ray: The ray in the camera frame is_valid: 1 if the operation is within bounds else 0 """ diff --git a/symforce/cam/posed_camera.py b/symforce/cam/posed_camera.py index c2dc645e9..402985e94 100644 --- a/symforce/cam/posed_camera.py +++ b/symforce/cam/posed_camera.py @@ -47,7 +47,7 @@ def pixel_from_global_point( point: Vector written in camera frame. epsilon: Small value intended to prevent division by 0. - Return: + Returns: pixel: UV coodinates in pixel units, assuming the point is in view is_valid: 1 if point is valid """ @@ -67,7 +67,7 @@ def global_point_from_pixel( range_to_point: Distance of the returned point along the ray passing through pixel epsilon: Small value intended to prevent division by 0. - Return: + Returns: global_point: The point in the global frame. is_valid: 1 if point is valid """ @@ -92,7 +92,7 @@ def warp_pixel( inverse_range: Inverse distance along the ray to the global point target_cam: Camera to project global point into - Return: + Returns: pixel: Pixel in the target camera is_valid: 1 if given point is valid in source camera and target camera """ diff --git a/symforce/codegen/cam_package_codegen.py b/symforce/codegen/cam_package_codegen.py index 5a0720930..f851b4174 100644 --- a/symforce/codegen/cam_package_codegen.py +++ b/symforce/codegen/cam_package_codegen.py @@ -29,7 +29,7 @@ def pixel_from_camera_point_with_jacobians( """ Project a 3D point in the camera frame into 2D pixel coordinates. - Return: + Returns: pixel: (x, y) coordinate in pixels if valid is_valid: 1 if the operation is within bounds else 0 pixel_D_cal: Derivative of pixel with respect to intrinsic calibration parameters @@ -48,7 +48,7 @@ def camera_ray_from_pixel_with_jacobians( """ Backproject a 2D pixel coordinate into a 3D ray in the camera frame. - Return: + Returns: camera_ray: The ray in the camera frame (NOT normalized) is_valid: 1 if the operation is within bounds else 0 point_D_cal: Derivative of point with respect to intrinsic calibration parameters