Skip to content

first pass at ruff linter fixes - #68

Merged
sritchie merged 9 commits into
mainfrom
sritchie/lint
Jul 23, 2024
Merged

sritchie merged 9 commits into
mainfrom
sritchie/lint

Conversation

@sritchie

@sritchie sritchie commented Jul 20, 2024 •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Contributor

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

Comment thread b3d/renderer/renderer.py
dy, ddb = diffs

grads = _rasterize_bwd_custom_call(
_rasterize_bwd_custom_call(

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.

note to stare at this one more closely

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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