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

_:hammer_and_wrench: Refactor suggestion_ #36

Open
mmcdermott opened this issue Oct 11, 2024 · 0 comments
Open

_:hammer_and_wrench: Refactor suggestion_ #36

mmcdermott opened this issue Oct 11, 2024 · 0 comments

Comments

@mmcdermott
Copy link
Owner

          _:hammer_and_wrench: Refactor suggestion_

Use enumerate for Cleaner Looping

In _slice_single, replace manual index tracking with enumerate:

-    i = 0
-    for dim in sorted(squeeze_dims):
-        out = out.squeeze(dim - i)
-        i += 1
+    for i, dim in enumerate(sorted(squeeze_dims)):
+        out = out.squeeze(dim - i)

This change improves clarity and conciseness.

Committable suggestion was skipped due to low confidence.

🧰 Tools
🪛 Ruff

1261-1261: Use enumerate() for index variable i in for loop

(SIM113)

Originally posted by @coderabbitai[bot] in #35 (comment)

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

No branches or pull requests

1 participant