Skip to content

Conversation

FrancescAlted
Copy link
Member

@FrancescAlted FrancescAlted commented Sep 29, 2025

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 as blosc2.Array.

As a plus, and thanks to the @runtime_checkable decorator, compliance with the new Array protocol can be tested at runtime with isinstance(object, blosc2.Array).

@FrancescAlted FrancescAlted merged commit 98ba424 into main Sep 30, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants