Skip to content

Commit 8bdf062

Browse files
committed
pre-commit linting
1 parent 0e783e7 commit 8bdf062

File tree

6 files changed

+12
-22
lines changed

6 files changed

+12
-22
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ MANIFEST
3434
*.manifest
3535
*.spec
3636

37+
# scikit-build-core dynamic version
38+
src/cubed/version.py
39+
3740
# Installer logs
3841
pip-log.txt
3942
pip-delete-this-directory.txt

src/cubed/vendor/dask/array/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from numbers import Number
55

66
import numpy as np
7-
from tlz import first, frequencies
7+
from tlz import frequencies
88

99
from ..utils import is_integer, parse_bytes
1010

@@ -312,7 +312,7 @@ def auto_chunks(chunks, shape, limit, dtype, previous_chunks=None):
312312
return tuple(chunks)
313313

314314
if limit is None:
315-
limit = "128MiB" # config.get("array.chunk-size")
315+
limit = "128MiB" # config.get("array.chunk-size")
316316
if isinstance(limit, str):
317317
limit = parse_bytes(limit)
318318

src/cubed/vendor/dask/array/core.pyi

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@ from typing import List, Optional, Tuple
33
from cubed.types import T_Chunks, T_DType, T_RectangularChunks, T_Shape
44

55
def _check_regular_chunks(chunkset: T_RectangularChunks) -> bool: ...
6-
7-
def broadcast_chunks(
8-
*chunkss
9-
) -> Tuple[Tuple[int, ...]]: ...
10-
6+
def broadcast_chunks(*chunkss) -> Tuple[Tuple[int, ...]]: ...
117
def common_blockdim(blockdims: List[Tuple[int, ...]]) -> Tuple[int, ...]: ...
12-
138
def normalize_chunks(
149
chunks: T_Chunks,
1510
shape: Optional[T_Shape] = None,
1611
limit: Optional[int] = None,
1712
dtype: Optional[T_DType] = None,
1813
previous_chunks: Optional[T_RectangularChunks] = None,
19-
) -> T_RectangularChunks:
20-
...
14+
) -> T_RectangularChunks: ...

src/cubed/vendor/dask/blockwise.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,6 @@ def lol_product(head, values):
358358
return lol_product(head + (values[0],), values[1:])
359359

360360

361-
362-
363-
364-
365-
366361
def broadcast_dimensions(argpairs, numblocks, sentinels=(1, (1,)), consolidate=None):
367362
"""Find block dimensions from arguments
368363

src/cubed/vendor/rechunker/algorithm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Core rechunking algorithm stuff."""
2+
23
import logging
34
import warnings
45
from math import ceil, floor, prod
@@ -270,7 +271,6 @@ def multistage_rechunking_plan(
270271

271272
# increase the number of stages until min_mem is exceeded
272273
for stage_count in range(1, MAX_STAGES):
273-
274274
stage_chunks = calculate_stage_chunks(read_chunks, write_chunks, stage_count)
275275
pre_chunks = [read_chunks] + stage_chunks
276276
post_chunks = stage_chunks + [write_chunks]
@@ -297,6 +297,7 @@ def multistage_rechunking_plan(
297297
f"Consider decreasing min_mem ({min_mem}) or increasing "
298298
f"({max_mem}) to find a more efficient plan.",
299299
category=ExcessiveIOWarning,
300+
stacklevel=2,
300301
)
301302
assert prev_plan is not None
302303
return prev_plan

src/cubed/vendor/rechunker/types.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Types definitions used by executors."""
2+
23
from dataclasses import dataclass
34
from typing import (
45
Any,
@@ -61,12 +62,8 @@ class CopySpec(NamedTuple):
6162

6263

6364
Config = Any # TODO: better typing for config
64-
SingleArgumentStageFunction = Callable[
65-
[Any, NamedArg(type=Any, name="config")], None
66-
] # noqa: F821
67-
NoArgumentStageFunction = Callable[
68-
[NamedArg(type=Any, name="config")], None
69-
] # noqa: F821
65+
SingleArgumentStageFunction = Callable[[Any, NamedArg(type=Any, name="config")], None] # noqa: F821
66+
NoArgumentStageFunction = Callable[[NamedArg(type=Any, name="config")], None] # noqa: F821
7067
StageFunction = Union[NoArgumentStageFunction, SingleArgumentStageFunction]
7168

7269

0 commit comments

Comments
 (0)