From df486c7d83a68e98471d3105a7c0cf2d198fd9ea Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Feb 2023 03:40:53 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e7773b0f..09c617ee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: args: [--profile, black] - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.1.0 hooks: - id: black From ab208573e3a72188457960680e272c5c86a12c33 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Feb 2023 03:41:51 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pye3d/geometry/intersections.py | 2 -- pye3d/geometry/projections.py | 2 -- pye3d/geometry/utilities.py | 6 ------ pye3d/refraction.py | 1 - tests/integration/test_synthetic_metrics.py | 3 --- 5 files changed, 14 deletions(-) diff --git a/pye3d/geometry/intersections.py b/pye3d/geometry/intersections.py index d3de3a79..bbcb72d5 100644 --- a/pye3d/geometry/intersections.py +++ b/pye3d/geometry/intersections.py @@ -116,7 +116,6 @@ def normalise(p1, p2): b0 = diff.dot(d1) if np.abs(a01) < 1.0: - # Lines are not parallel. det = 1.0 - a01 * a01 b1 = -diff.dot(d2) @@ -124,7 +123,6 @@ def normalise(p1, p2): s1 = (a01 * b0 - b1) / det else: - # Lines are parallel, select any pair of closest points. s0 = -b0 s1 = 0 diff --git a/pye3d/geometry/projections.py b/pye3d/geometry/projections.py index bfbb6384..ce119ed8 100644 --- a/pye3d/geometry/projections.py +++ b/pye3d/geometry/projections.py @@ -62,7 +62,6 @@ def project_circle_into_image_plane( disc_ = conic.discriminant() if disc_ < 0: - A, B, C, D, E, F = conic.A, conic.B, conic.C, conic.D, conic.E, conic.F center_x = (2 * C * D - B * E) / disc_ center_y = (2 * A * E - B * D) / disc_ @@ -91,7 +90,6 @@ def project_circle_into_image_plane( return Ellipse(np.asarray([center_x, center_y]), minor_axis, major_axis, angle) else: - return False diff --git a/pye3d/geometry/utilities.py b/pye3d/geometry/utilities.py index b3f5923b..c8f59bf8 100644 --- a/pye3d/geometry/utilities.py +++ b/pye3d/geometry/utilities.py @@ -2,7 +2,6 @@ def cart2sph(x): - phi = np.arctan2(x[2], x[0]) theta = np.arccos(x[1] / np.linalg.norm(x)) @@ -10,7 +9,6 @@ def cart2sph(x): def sph2cart(phi, theta): - result = np.empty(3) result[0] = np.sin(theta) * np.cos(phi) @@ -21,12 +19,10 @@ def sph2cart(phi, theta): def normalize(v, axis=-1): - return v / np.linalg.norm(v, axis=axis) def enclosed_angle(v1, v2, unit="deg", axis=-1): - v1 = normalize(v1, axis=axis) v2 = normalize(v2, axis=axis) @@ -39,7 +35,6 @@ def enclosed_angle(v1, v2, unit="deg", axis=-1): def make_homogeneous_vector(v): - return np.hstack((v, [0.0])) @@ -58,7 +53,6 @@ def transform_as_homogeneous_vector(v, trafo): def rotate_v1_on_v2(v1, v2): - v1 = normalize(v1) v2 = normalize(v2) cos_angle = np.dot(v1, v2) diff --git a/pye3d/refraction.py b/pye3d/refraction.py index 05d5fddb..154c4a14 100644 --- a/pye3d/refraction.py +++ b/pye3d/refraction.py @@ -133,7 +133,6 @@ def load_predict_fn_from_joblib_pickle( if __name__ == "__main__": - refractionizer = Refractionizer() print(refractionizer.correct_sphere_center([[0.0, 0.0, 35.0]])) diff --git a/tests/integration/test_synthetic_metrics.py b/tests/integration/test_synthetic_metrics.py index 489c8018..347f5919 100644 --- a/tests/integration/test_synthetic_metrics.py +++ b/tests/integration/test_synthetic_metrics.py @@ -300,7 +300,6 @@ def eye_center_3d_errors(dataset): @pytest.fixture(scope="module") def dataset(): - # Check all input files exist assert INPUT_PATH.is_file(), f"Missing test input file: {INPUT_PATH}" @@ -325,7 +324,6 @@ def dataset(): measured_data = [] for i, img in enumerate(images): - pupil_datum, _ = pupil_datum_from_raytraced_image(img=img) pupil_datum["timestamp"] = i / FPS @@ -476,7 +474,6 @@ def pupil_datum_from_raytraced_image(img=None, raytracer=None, device="cpu"): ) # -pi/2 due to version change of regionprops if props: - # adapt output of regionprops to construct pupil datum analoguous to # Pupil 2D Detector: pupil_datum["ellipse"]["axes"] = np.array(