Skip to content

More ruff fixes - #77

Merged
sritchie merged 8 commits into
mainfrom
sritchie/lint_again
Jul 23, 2024
Merged

More ruff fixes#77
sritchie merged 8 commits into
mainfrom
sritchie/lint_again

Conversation

@sritchie

@sritchie sritchie commented Jul 23, 2024

Copy link
Copy Markdown
Collaborator

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

Comment thread src/b3d/mesh.py
def shape(self):
return self.vertices.shape[:-1]

def __len__(self):

Copy link
Copy Markdown
Collaborator 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

)
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
Copy Markdown
Collaborator 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

Comment thread src/b3d/utils.py

@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
Copy Markdown
Collaborator 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


# Origin of the camera frame
O = jnp.zeros(3)
origin = jnp.zeros(3)

Copy link
Copy Markdown
Collaborator 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 requested a review from nishadgothoskar July 23, 2024 16:33
@sritchie
sritchie merged commit e539c74 into main Jul 23, 2024
@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