Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a new Array protocol that is useful to describe the minimal interface that should be supported for blosc2 functions to deal with array inputs. This protocol is really minimal, and it does not actually depend on any non-standard array API method or property (like
.chunks
); @lshaw8317 hope this is fine for most (if not all) the signature changes proposed here, but if not, we need to discuss which cases require a more complete interface (blosc2.ChunkedArray ?).So instead of describing the input types as e.g.
NDArray | NDField | C2Array | LazyArray
, they are described now asblosc2.Array
.As a plus, and thanks to the
@runtime_checkable
decorator, compliance with the new Array protocol can be tested at runtime withisinstance(object, blosc2.Array)
.