Skip to content

Commit

Permalink
Merge pull request #65 from pupil-labs/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
papr authored Feb 7, 2023
2 parents 41d99d8 + ab20857 commit bcd3e25
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions pye3d/geometry/intersections.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,13 @@ 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)
s0 = (a01 * b1 - b0) / det
s1 = (a01 * b0 - b1) / det

else:

# Lines are parallel, select any pair of closest points.
s0 = -b0
s1 = 0
Expand Down
2 changes: 0 additions & 2 deletions pye3d/geometry/projections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down Expand Up @@ -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


Expand Down
6 changes: 0 additions & 6 deletions pye3d/geometry/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@


def cart2sph(x):

phi = np.arctan2(x[2], x[0])
theta = np.arccos(x[1] / np.linalg.norm(x))

return phi, theta


def sph2cart(phi, theta):

result = np.empty(3)

result[0] = np.sin(theta) * np.cos(phi)
Expand All @@ -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)

Expand All @@ -39,7 +35,6 @@ def enclosed_angle(v1, v2, unit="deg", axis=-1):


def make_homogeneous_vector(v):

return np.hstack((v, [0.0]))


Expand All @@ -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)
Expand Down
1 change: 0 additions & 1 deletion pye3d/refraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]))
Expand Down
3 changes: 0 additions & 3 deletions tests/integration/test_synthetic_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand All @@ -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

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit bcd3e25

Please sign in to comment.