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

first pass at ruff linter fixes #68

Merged
merged 9 commits into from
Jul 23, 2024
Merged

first pass at ruff linter fixes #68

merged 9 commits into from
Jul 23, 2024

Conversation

sritchie
Copy link
Contributor

@sritchie sritchie commented Jul 20, 2024

This PR:

  • fixes many ruff linter errors, removing unused imports and variables
  • disables ruff formatting and linting for ipynb files

I verified that all tests pass on a cloud VM.

@georgematheos
Copy link
Collaborator

@sritchie thank you for making this PR!

Two questions, from a quick look --

  1. Have you run the tests successfully on this? I ask because this removes a few lines of the form from . import X, in Y/__init__.py files, and I'm wondering if this breaks any of the tests which are expecting to be able to import Y.X.
  2. It looks like this PR changes a number of lines of the form varname = expression() to expression(), and for most of these, expression() does not have a side effect. Is the best bet to go through and remove all of these manually? (Maybe it would be better to try to automatically delete all these lines, and then hope the tests catch if this has broken anything relying on side effects.)

@sritchie
Copy link
Contributor Author

@georgematheos it would definitely be good to go remove those lines, I just didn't know enough myself to know which lines were relying on side effects and which were not. I'm happy to go get it done.

Let me try the tests on this today, and if they look good, what do you think about giving an approval here?

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

grads = _rasterize_bwd_custom_call(
_rasterize_bwd_custom_call(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note to stare at this one more closely

Copy link
Collaborator

Choose a reason for hiding this comment

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

@nishadgothoskar can you please comment on this? -- Do we need to call _rasterize_bwd_custom_call here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

(@sritchie I am not familiar with all the code in renderer.py, so we probably need Nishad's input here.)

@sritchie sritchie merged commit 7c9208d into main Jul 23, 2024
1 check passed
@sritchie sritchie deleted the sritchie/lint branch July 23, 2024 13:40
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.

2 participants