-
-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Top level V3 API #1884
Conversation
…nto feature/top-level-api
…nto feature/top-level-api
This is ready for an initial review. To set expectations, I don't plan to address the following optional arguments in this PR:
These will need to be handled in later PRs. |
src/zarr/common.py
Outdated
@@ -35,6 +35,7 @@ | |||
Selection = slice | SliceSelection | |||
ZarrFormat = Literal[2, 3] | |||
JSON = None | str | int | float | Enum | dict[str, "JSON"] | list["JSON"] | tuple["JSON", ...] | |||
MEMORY_ORDER = Literal["C", "F"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MEMORY_ORDER = Literal["C", "F"] | |
MemoryOrder = Literal["C", "F"] |
src/zarr/api/asynchronous.py
Outdated
make_store_path, | ||
) | ||
|
||
ShapeLike = tuple[int, ...] # TODO: support int for shape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use ChunkCoords
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but maybe not for long. I went ahead and changed it but ShapeLike was intended to be int | tuple[int, ...]
... Perhaps that will work for ChunkCoords too?
src/zarr/api/asynchronous.py
Outdated
return shape, chunks | ||
|
||
|
||
def _like_args(a: ArrayLike, kwargs: dict[str, Any]) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of mutating kwargs, can we copy it, and make changes to the copy, and return it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. This function was coped from v2 but is now refactored along the lines of what you were suggesting.
I added a few minor comments, none of which are blockers. A few high-level thoughts: A lot of the routines
This works for me.
Definitely prefer what we have here over |
…nto feature/top-level-api
Hi, thanks for all the work on this.
Is |
Hi @will-moore -- interesting to find out that Dask is using the array constructor directly. I would have expected to see btw, |
I'm planning to merge this in the morning unless I get further reviews. |
* v3: (22 commits) [v3] `Buffer` ensure correct subclass based on the `BufferPrototype` argument (zarr-developers#1974) Fix doc build (zarr-developers#1987) Fix doc build warnings (zarr-developers#1985) Automatically generate API reference docs (zarr-developers#1918) Update `RemoteStore.__str__` and add UPath tests (zarr-developers#1964) [v3] Elevate codec pipeline (zarr-developers#1932) 0 dim arrays: indexing (zarr-developers#1980) `parse_shapelike` allows 0 (zarr-developers#1979) Clean up typing and docs for indexing (zarr-developers#1961) add json indentation to config (zarr-developers#1952) chore: update pre-commit hooks (zarr-developers#1973) Bump pypa/gh-action-pypi-publish in the actions group (zarr-developers#1969) chore: update pre-commit hooks (zarr-developers#1957) Update release.rst (zarr-developers#1960) doc: update release notes for 3.0.0.alpha (zarr-developers#1959) Basic working FsspecStore (zarr-developers#1785) Feature: Top level V3 API (zarr-developers#1884) Buffer Prototype Argument (zarr-developers#1910) Create issue-metrics.yml fixes bug in transpose (zarr-developers#1949) ...
Marking as Work In Progress for now. Currently waiting on #1670 to merge.
Closes #1598
Fixes #1019
Open questions I could use feedback on:
zarr.creation
andzarr.convenience
into a common API module. This makes sense to me because they are all basically wrappers that help us construct Group/Array objects. What people think about this?ones
andasync_ones
). Thoughts?More soon.
TODO:
cc @d-v-b, @aldenks