Ruff check - #937
Merged
Merged
Ruff check#937
Conversation
Contributor
Author
|
See #938 for failing MKL tests. |
joostvanzwieten
previously approved these changes
Sep 3, 2026
| def _multiply(self, other): | ||
| if isinstance(other, Choose) and self.index == other.index: | ||
| return Choose(self.index, self.choices * other.choices) | ||
| return Choose(self.index, tuple(c1 * c2 for c1, c2 in zip(self.choices, other.choices))) |
Member
There was a problem hiding this comment.
Shouldn't we check here that self and other have the same number of items?
Contributor
Author
There was a problem hiding this comment.
Good catch. Fixed and I also added the equivalent ._add simplification plus unit tests.
gertjanvanzwieten
force-pushed
the
next
branch
from
September 4, 2026 09:13
265cc8e to
aca09a7
Compare
This patch changes the imports in matrix._auto from "from .x import assemble" to "from . import x as _backend; assemble = _backend.assemble". The new, lengthier form serves to make assemble's role as a module attribute clear to tools like ruff check, which would otherwise suggest to remove the seemingly unused import statements.
This patch contains all the fixes that ruff can apply automatically, such as removing unused imports and unused format strings.
This patch fixes all issues flagged by ruff check --select F811: redefined-while-unused.
This patches fixes all issues flagged by ruff check --select F841: unused-variable.
This patch enables the test_normals tests, which were inactive due to missing test_ prefixes, and fixes some issues caused by deprecated syntax.
This patch fixes most issues flagged by ruff check --select F821: undefined-name, with the exeption of false positives. These are variables that are undefined only in the first iteration of a loop, or type annotations that avoid circular imports.
This patch fixes all issues flagged by ruff check --select E721: type-comparison, which favours "is" and "is not" over "==" and "!=" when comparing type objects.
This patch fixes all issues flagged by ruff check --select E711: not-is-test, which favours "is None" over "== None".
This patch fixes all issues flagged by ruff check --select F401: unused-import.
This patch fixes all issues flagged by ruff check --select E701: multiple-statements-on-one-line-colon.
gertjanvanzwieten
force-pushed
the
next
branch
from
September 18, 2026 12:49
aca09a7 to
bd21504
Compare
Contributor
Author
|
Rebased on top of #939 and limited to ruff fixes, remaining changes to follow in a separate PR. |
joostvanzwieten
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.