Skip to content

Enforce ruff/Pylint Convention rules (PLC) #10460

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

Merged
merged 5 commits into from
Jun 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply ruff/Pylint rule PLC1802
PLC1802 `len()` used as condition without comparison
  • Loading branch information
DimitriPapadopoulos committed Jun 28, 2025
commit 138a2a4d85cecbc051da9570367af84d8336ed61
2 changes: 1 addition & 1 deletion xarray/tests/test_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ def test_map_blocks_da_ds_with_template(obj):

# Check that indexes are written into the graph directly
dsk = dict(actual.__dask_graph__())
assert len({k for k in dsk if "x-coordinate" in k})
assert {k for k in dsk if "x-coordinate" in k}
assert all(
isinstance(v, PandasIndex) for k, v in dsk.items() if "x-coordinate" in k
)
Expand Down
2 changes: 1 addition & 1 deletion xarray/ufuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_array_namespace(*args):
names = [module.__name__ for module in xps]
raise ValueError(f"Mixed array types {names} are not supported.")

return next(iter(xps)) if len(xps) else np
return next(iter(xps)) if xps else np


class _ufunc_wrapper(ABC):
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy