-
-
Notifications
You must be signed in to change notification settings - Fork 150
refactor(ruff): switch from select
to ignore
#1412
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
base: main
Are you sure you want to change the base?
Changes from 14 commits
f99f004
c664a0d
d120bea
1b34b99
85ab0f9
6847e86
06f1136
3e7bb89
faa516e
2e81ce6
5cb4685
83518db
b6394f9
ace7a24
f251900
0a322ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,8 +87,7 @@ def check( | |
and get_origin(shape_type) is tuple | ||
and (tuple_args := get_args(shape_type)) | ||
and ... not in tuple_args # fixed-length tuple | ||
and (arr_ndim := getattr(actual, "ndim")) | ||
!= (expected_ndim := len(tuple_args)) | ||
and (arr_ndim := actual.ndim) != (expected_ndim := len(tuple_args)) # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue] | ||
|
||
): | ||
raise RuntimeError( | ||
f"Array has wrong dimension {arr_ndim}, expected {expected_ndim}" | ||
|
@@ -100,7 +99,7 @@ def check( | |
and (dtype_args := get_args(dtype_type)) | ||
and isinstance((expected_dtype := dtype_args[0]), type) | ||
and issubclass(expected_dtype, np.generic) | ||
and (arr_dtype := getattr(actual, "dtype")) != expected_dtype | ||
and (arr_dtype := actual.dtype) != expected_dtype # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue] | ||
|
||
): | ||
raise RuntimeError( | ||
f"Array has wrong dtype {arr_dtype}, expected {expected_dtype.__name__}" | ||
|
@@ -208,8 +207,6 @@ def pytest_warns_bounded( | |
current = Version(version_str) | ||
if lb < current < ub: | ||
return pytest.warns(warning, match=match) | ||
else: | ||
if upper_exception is None: | ||
return nullcontext() | ||
else: | ||
return suppress(upper_exception) | ||
if upper_exception is None: | ||
return nullcontext() | ||
return suppress(upper_exception) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO is in one file, so can we make this a single file ignore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed