Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More ruff fixes #77

Merged
merged 8 commits into from
Jul 23, 2024
Merged

More ruff fixes #77

merged 8 commits into from
Jul 23, 2024

Conversation

sritchie
Copy link
Contributor

@sritchie sritchie commented Jul 23, 2024

This PR:

  • turns on the ruff configuration that we're using for genjax
  • adds it to the pre-commit hooks
  • auto-fixes most errors (unsorted imports, unused local variables etc)
  • manually fixes the last few

@@ -210,9 +211,6 @@ def cube_mesh(dimensions=jnp.ones(3), color=jnp.array([1.0, 0.0, 0.0])):
def shape(self):
return self.vertices.shape[:-1]

def __len__(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nishadgothoskar these were duplicates of code above

@@ -136,6 +138,7 @@ def _rasterize_bwd(self, saved_tensors, diffs):
)
dy, ddb = diffs

# Don't delete! This call has the side-effect of preventing JAX from complaining when we call `grad` on a `Renderer`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here's the comment I added addressing our issue from before

@@ -103,7 +105,7 @@ def downsize_images(ims, k):


@jax.jit
def xyz_from_depth(z: "Depth Image", fx, fy, cx, cy):
def xyz_from_depth(z: rr.DepthImage, fx, fy, cx, cy):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was a bug, fixed this to refer to the correct type

@@ -24,17 +25,17 @@ def gt_informed_triangle_proposal(gt_triangle, mindepth, maxdepth, fx, fy, cx, c
A, B, C = gt_triangle

# Origin of the camera frame
O = jnp.zeros(3)
origin = jnp.zeros(3)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed an "ambiguous name" linter error

@sritchie sritchie merged commit e539c74 into main Jul 23, 2024
1 check passed
@sritchie sritchie deleted the sritchie/lint_again branch July 23, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant