(feat): add async versions of {write,read}_{elem,dispatched}#1902
(feat): add async versions of {write,read}_{elem,dispatched}#1902
async versions of {write,read}_{elem,dispatched}#1902Conversation
Benchmark changes
Warning Some benchmarks failed Comparison: https://github.com/scverse/anndata/compare/3a472c77287154746874a99e5aaa8d99bf63c1b4..8855231ff71cce6fda2de01cc6fb0b3fc8bd51fc More details: https://github.com/scverse/anndata/pull/1902/checks?check_run_id=38719466194 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1902 +/- ##
==========================================
- Coverage 86.47% 80.13% -6.35%
==========================================
Files 45 45
Lines 6774 6739 -35
==========================================
- Hits 5858 5400 -458
- Misses 916 1339 +423
🚀 New features to boost your workflow:
|
| return reader.read_elem(elem) | ||
|
|
||
|
|
||
| async def read_dispatched_async( |
There was a problem hiding this comment.
Maybe this doesn’t need to be a separate function.
We could just check if the callback returns something awaitable, right?
There was a problem hiding this comment.
So we would have just
def read_dispatched (...) -> Coroutine | AnnDataand then it would be up to users to deal with it? Or you mean that all of the "duplicated" code should be made to just handle coroutines and not (which I kind of like)
async versions of read_{elem,dispatched}async versions of {write,read}_{elem,dispatched}
|
I haven't checked the code, but i see |
|
@Koncopd yes I am aware. This was just a first pass - we are going a different route with this feature, I think. Message me on zulip if you want more information, happy to chat. |
|
Yeah, i think the correct way here is to create an event loop in a separate thread and execute all async functions using this event loop, like |
Yes, the plan is actually to use |
|
asyncinternally forread_elemandwrite_elem#1897