You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, we have no way to evolve the interface in a backwards compatible way. #2845 noted an accidental API break.
One option for gracefully evolving the spec here, which I might need for #2904, is to replace the tuples with dataclasses. We can safely add new optional fields to the dataclass without breaking backwards compatibility.
We can define __len__ and __iter__ on the dataclasses and freeze their return values to the current API.
And potentially we would warn when accessing the fields through iteration or position, to encourage pipeline implementations to migrate to the new system.
Steps to reproduce
na
Additional output
No response
The text was updated successfully, but these errors were encountered:
Zarr version
v3
Numcodecs version
na
Python Version
na
Operating System
na
Installation
na
Description
Currently, the
CodecPipeline
interface works by passing aroundIterable[tuple[...]]
for various types of tuples. For exampledecode
:zarr-python/src/zarr/abc/codec.py
Line 115 in 5ff3fbe
Iterable[tuple[CodecOutput | None, ArraySpec]]
Iterable[tuple[CodecInput | None, ArraySpec]]
Iterable[tuple[ByteGetter, ArraySpec, SelectorTuple, SelectorTuple, bool]]
Iterable[tuple[ByteSetter, ArraySpec, SelectorTuple, SelectorTuple, bool]]
At the moment, we have no way to evolve the interface in a backwards compatible way. #2845 noted an accidental API break.
One option for gracefully evolving the spec here, which I might need for #2904, is to replace the tuples with dataclasses. We can safely add new optional fields to the dataclass without breaking backwards compatibility.
We can define
__len__
and__iter__
on the dataclasses and freeze their return values to the current API.And potentially we would warn when accessing the fields through iteration or position, to encourage pipeline implementations to migrate to the new system.
Steps to reproduce
na
Additional output
No response
The text was updated successfully, but these errors were encountered: