Skip to content

feat: top-level function for running awaitables in zarr's event loop#3997

Open
d-v-b wants to merge 4 commits into
zarr-developers:mainfrom
d-v-b:feat/public-run
Open

feat: top-level function for running awaitables in zarr's event loop#3997
d-v-b wants to merge 4 commits into
zarr-developers:mainfrom
d-v-b:feat/public-run

Conversation

@d-v-b
Copy link
Copy Markdown
Contributor

@d-v-b d-v-b commented May 22, 2026

following up on #3859 and the discussion in #3835, this PR adds a new top-level function run function that wraps the internal sync function. One notable difference between run and sync is that run raises a RuntimeError (like asyncio.run) when its invoked in a running loop.

While i would still prefer people go through higher-level apis for doing batch IO operations, we haven't gotten around to actually writing those APIs, and users need better perf today.

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 in docs/user-guide/*.md
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@d-v-b
Copy link
Copy Markdown
Contributor Author

d-v-b commented May 22, 2026

@TomNicholas, @aladinor let me know how this looks

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.50%. Comparing base (c0e2afa) to head (018a341).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3997   +/-   ##
=======================================
  Coverage   93.49%   93.50%           
=======================================
  Files          88       88           
  Lines       11873    11878    +5     
=======================================
+ Hits        11101    11106    +5     
  Misses        772      772           
Files with missing lines Coverage Δ
src/zarr/__init__.py 100.00% <100.00%> (ø)
src/zarr/core/sync.py 94.54% <100.00%> (+0.20%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@d-v-b d-v-b requested a review from jhamman May 22, 2026 13:53
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.

1 participant