Skip to content

Commit 656283e

Browse files
committed
Disallow untyped calls
1 parent 533a7b0 commit 656283e

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ disallow_untyped_decorators = true
168168
disallow_any_generics = true
169169

170170
disallow_incomplete_defs = true
171+
disallow_untyped_calls = true
171172

172173
[[tool.mypy.overrides]]
173174
module = [
@@ -199,6 +200,19 @@ module = [
199200
]
200201
disallow_incomplete_defs = false
201202

203+
[[tool.mypy.overrides]]
204+
module = [
205+
"zarr.array",
206+
"zarr.array_v2",
207+
"zarr.common",
208+
"zarr.store.local",
209+
"zarr.codecs.blosc",
210+
"zarr.codecs.gzip",
211+
"zarr.codecs.zstd",
212+
]
213+
disallow_untyped_calls = false
214+
215+
202216
[tool.pytest.ini_options]
203217
doctest_optionflags = [
204218
"NORMALIZE_WHITESPACE",

src/zarr/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class ArraySpec:
7979
dtype: np.dtype[Any]
8080
fill_value: Any
8181

82-
def __init__(self, shape, dtype, fill_value):
82+
def __init__(self, shape: ChunkCoords, dtype: np.dtype[Any], fill_value: Any) -> None:
8383
shape_parsed = parse_shapelike(shape)
8484
dtype_parsed = parse_dtype(dtype)
8585
fill_value_parsed = parse_fill_value(fill_value)

src/zarr/indexing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def _err_too_many_indices(selection: SliceSelection, shape: ChunkCoords) -> None
1919
)
2020

2121

22-
def _err_negative_step():
22+
def _err_negative_step() -> None:
2323
raise IndexError("only slices with step >= 1 are supported")
2424

2525

@@ -50,7 +50,7 @@ class _ChunkDimProjection(NamedTuple):
5050
dim_out_sel: Optional[slice]
5151

5252

53-
def _ceildiv(a, b):
53+
def _ceildiv(a: float, b: float) -> int:
5454
return math.ceil(a / b)
5555

5656

0 commit comments

Comments
 (0)