-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
Apply and enforce more ruff rules #2053
Conversation
0f1d160
to
aff1ee5
Compare
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.
Everything here looks good @DimitriPapadopoulos.
cc'ing @dstansby for a final review and look at the open mypy question
aff1ee5
to
42657f3
Compare
81fee09
to
4429df6
Compare
@DimitriPapadopoulos - lots of merge conflicts here. Mind taking this one from the top? |
It might be easier to restart from scratch. Let me have a look. |
a01f1b7
to
4e919e2
Compare
OK, I have re-applied all rules from scratch, leaving |
f5524ee
to
80618fb
Compare
Rebased. |
254b32c
to
d26f5d3
Compare
Because
I ended up deciding this is a MyPy issue and ignoring |
12e8393
to
05768ea
Compare
PERF102 When using only the keys of a dict use the `keys()` method
df4d7e9
to
01d8480
Compare
@jhamman This merge request seems ready for a review. |
d90ed39
to
b5b002a
Compare
PERF401 Use an async list comprehension to create a transformed list
Ignore lint rules conflicting with the ruff formatter
PGH003 Use specific rule codes when ignoring type issues
PGH004 Use specific rule codes when using `noqa`
C417 Unnecessary `map` usage (rewrite using a generator expression)
PYI032 Prefer `object` to `Any` for the second parameter to `__eq__`
PYI036 Returning Any from function
PYI041 Use `complex` instead of `float | complex` PYI041 Use `float` instead of `int | float`
PYI055 Multiple `type` members in a union. Combine them into one.
b5b002a
to
eba9d47
Compare
Thanks @DimitriPapadopoulos! |
chunks_accessed = [ | ||
".".join([str(ci) for ci in comb]) for comb in itertools.product(*chunks_per_dim) | ||
] |
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.
Maybe we can simplify this a bit further?
chunks_accessed = [ | |
".".join([str(ci) for ci in comb]) for comb in itertools.product(*chunks_per_dim) | |
] | |
chunks_accessed = [ | |
".".join(map(str, comb)) for comb in itertools.product(*chunks_per_dim) | |
] |
Please see PR: #2229
* v3: (21 commits) Default zarr.open to open_group if shape is not provided (zarr-developers#2158) feat: metadata-only support for storage transformers metadata (zarr-developers#2180) fix(async): set default concurrency to 10 tasks (zarr-developers#2256) chore(deps): drop support for python 3.10 and numpy 1.24 (zarr-developers#2217) feature(store): add LoggingStore wrapper (zarr-developers#2231) Apply assorted ruff/flake8-simplify rules (SIM) (zarr-developers#2259) Add array storage helpers (zarr-developers#2065) Apply ruff/flake8-annotations rule ANN204 (zarr-developers#2258) No need to run DeepSource any more - we use ruff (zarr-developers#2261) Remove unnecessary lambda expression (zarr-developers#2260) Enforce ruff/flake8-comprehensions rules (C4) (zarr-developers#2239) Use `map(str, *)` in `test_accessed_chunks` (zarr-developers#2229) Replace Gitter with Zulip (zarr-developers#2254) Enforce ruff/flake8-pytest-style rules (PT) (zarr-developers#2236) Fix multiple identical imports (zarr-developers#2241) Enforce ruff/flake8-return rules (RET) (zarr-developers#2237) Enforce ruff/flynt rules (FLY) (zarr-developers#2240) Fix fill_value handling for complex dtypes (zarr-developers#2200) Update V2 codec pipeline to use concrete classes (zarr-developers#2244) Apply and enforce more ruff rules (zarr-developers#2053) ...
PERF401
, but do not enforce for now - see Apply ruff/Perflint rule PERF401 pypa/setuptools#4449 (comment) and MAINT: start applying ruff/Perflint rules (PERF) numpy/numpy#26876 (comment) and make your own opinion 😄PT022
. Do not enforce for now, I fear you won't like otherPT
rules.EnforceTCH
rules.PGH
rules.C405
andC417
. Do not enforce for now, someC4
rules seem too strict.PYI
rules.Fix pre-commit warnings and errors as they occurCatch more precise exceptions thanException
TODO: