Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: makeasync_array public#3556

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
ilan-gold wants to merge3 commits intozarr-developers:main
base:main
Choose a base branch
Loading
fromilan-gold:ig/make_async_array_public

Conversation

@ilan-gold
Copy link
Contributor

@ilan-goldilan-gold commentedOct 27, 2025
edited
Loading

Given thata lot of people are using the privateArray._async_array, I think it should be documented and put in a public namespace. This PR specifically does not makezarr.core.sync.sync public becauseI'm not 100% sure it's necessary in the day-and-age ofobstore but also because I can definitely see arguments why a better API might be useful, certain one that does:

some_batching_api(my_sync_array.async_array.getitem(...),my_other_sync_array.async_array.getitem(...))

instead of

zarr.core.sync(asyncio.gather(my_sync_array.async_array.getitem(...),my_other_sync_array.async_array.getitem(...)))

Another reason I think making this public is because you may want to batch together these low level requests just because of the way people's APIs are structured rather than forcing everything to go through something like

some_batching_api(sync_arrays,selections)

Definitely open to opinions on this! Marked as draft for now!

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented indocs/user-guide/*.md
  • Changes documented as a new file inchanges/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@github-actionsgithub-actionsbot added the needs release notesAutomatically applied to PRs which haven't added release notes labelOct 27, 2025
@codecov
Copy link

codecovbot commentedOct 27, 2025
edited
Loading

Codecov Report

❌ Patch coverage is91.11111% with4 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.86%. Comparing base (c8d8e64) to head (c0446ad).

Files with missing linesPatch %Lines
src/zarr/core/array.py91.11%4 Missing⚠️
Additional details and impacted files
@@            Coverage Diff             @@##             main    #3556      +/-   ##==========================================- Coverage   61.87%   61.86%   -0.01%==========================================  Files          85       85                Lines       10134    10137       +3     ==========================================+ Hits         6270     6271       +1- Misses       3864     3866       +2
Files with missing linesCoverage Δ
src/zarr/core/array.py68.51% <91.11%> (-0.12%)⬇️
🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TomAugspurger
Copy link
Contributor

I'm fine with this, as long as we're OK making the implementation detail thatArray is backend by anAsyncArray part of the public API.

I would also pretty strongly encourage people using._async_array to consider whether they can use AsyncArray directly. Maybe they can't (because they in turn are offering a sync API).

d-v-b reacted with thumbs up emoji

@ilan-gold
Copy link
ContributorAuthor

I'm fine with this, as long as we're OK making the implementation detail that Array is backend by an AsyncArray part of the public API.

Another option would be to create ato_async function that could in theory be future proofed (although theproperty does the same thing) in the sense that we can remove the "is backed byAsyncArray" aspect of the implementation while maintaining API compat by implementing a "reopen" scheme under theasync_array property/to_async function (however it is implemented).

I would also pretty strongly encourage people using ._async_array to consider whether they can use AsyncArray directly. Maybe they can't (because they in turn are offering a sync API).

Agreed! I think the "offering a sync API" thing is the core of it, though.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

needs release notesAutomatically applied to PRs which haven't added release notes

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@ilan-gold@TomAugspurger@d-v-b

[8]ページ先頭

©2009-2025 Movatter.jp