Skip to content

Commit 5c16398

Browse files
Apply Pylint rule W0246 (useless-parent-delegation)
Useless parent or super() delegation in method '__init__'
1 parent 2e20948 commit 5c16398

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

src/zarr/codecs/numcodecs/_codecs.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ def __repr__(self) -> str:
137137

138138

139139
class _NumcodecsBytesBytesCodec(_NumcodecsCodec, BytesBytesCodec):
140-
def __init__(self, **codec_config: JSON) -> None:
141-
super().__init__(**codec_config)
142-
143140
async def _decode_single(self, chunk_data: Buffer, chunk_spec: ArraySpec) -> Buffer:
144141
return await asyncio.to_thread(
145142
as_numpy_array_wrapper,
@@ -159,9 +156,6 @@ async def _encode_single(self, chunk_data: Buffer, chunk_spec: ArraySpec) -> Buf
159156

160157

161158
class _NumcodecsArrayArrayCodec(_NumcodecsCodec, ArrayArrayCodec):
162-
def __init__(self, **codec_config: JSON) -> None:
163-
super().__init__(**codec_config)
164-
165159
async def _decode_single(self, chunk_data: NDBuffer, chunk_spec: ArraySpec) -> NDBuffer:
166160
chunk_ndarray = chunk_data.as_ndarray_like()
167161
out = await asyncio.to_thread(self._codec.decode, chunk_ndarray)
@@ -174,9 +168,6 @@ async def _encode_single(self, chunk_data: NDBuffer, chunk_spec: ArraySpec) -> N
174168

175169

176170
class _NumcodecsArrayBytesCodec(_NumcodecsCodec, ArrayBytesCodec):
177-
def __init__(self, **codec_config: JSON) -> None:
178-
super().__init__(**codec_config)
179-
180171
async def _decode_single(self, chunk_data: Buffer, chunk_spec: ArraySpec) -> NDBuffer:
181172
chunk_bytes = chunk_data.to_bytes()
182173
out = await asyncio.to_thread(self._codec.decode, chunk_bytes)
@@ -253,9 +244,6 @@ def evolve_from_array_spec(self, array_spec: ArraySpec) -> FixedScaleOffset:
253244

254245

255246
class Quantize(_NumcodecsArrayArrayCodec, codec_name="quantize"):
256-
def __init__(self, **codec_config: JSON) -> None:
257-
super().__init__(**codec_config)
258-
259247
def evolve_from_array_spec(self, array_spec: ArraySpec) -> Quantize:
260248
if self.codec_config.get("dtype") is None:
261249
dtype = array_spec.dtype.to_native_dtype()

src/zarr/core/buffer/cpu.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from collections.abc import Callable, Iterable
2020
from typing import Self
2121

22-
from zarr.core.buffer.core import ArrayLike, NDArrayLike
2322
from zarr.core.common import BytesLike
2423

2524

@@ -44,9 +43,6 @@ class Buffer(core.Buffer):
4443
array-like object that must be 1-dim, contiguous, and byte dtype.
4544
"""
4645

47-
def __init__(self, array_like: ArrayLike) -> None:
48-
super().__init__(array_like)
49-
5046
@classmethod
5147
def create_zero_length(cls) -> Self:
5248
return cls(np.array([], dtype="B"))
@@ -142,9 +138,6 @@ class NDBuffer(core.NDBuffer):
142138
ndarray-like object that is convertible to a regular Numpy array.
143139
"""
144140

145-
def __init__(self, array: NDArrayLike) -> None:
146-
super().__init__(array)
147-
148141
@classmethod
149142
def create(
150143
cls,

0 commit comments

Comments
 (0)