Skip to content

Commit 5ce3a50

Browse files
committed
deploy: eed69b8
1 parent 95e6d48 commit 5ce3a50

5 files changed

Lines changed: 59 additions & 4 deletions

File tree

blog/2025-anndata-012/index.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!doctype html><html><head><title>Improved i/o in anndata 0.12</title><link rel=stylesheet type=text/css href=/bootstrap/css/bootstrap.min.css><link rel=stylesheet type=text/css href=/bootstrap/icons/bootstrap-icons.css><link rel=stylesheet type=text/css href=/main.min.css><link rel=apple-touch-icon sizes=180x180 href=/img/favicon/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/img/favicon/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/img/favicon/favicon-16x16.png><link rel=manifest href=/img/favicon/site.webmanifest><link rel=mask-icon href=/img/favicon/safari-pinned-tab.svg color=#000000><link rel="shortcut icon" href=/img/favicon/favicon.ico><meta name=msapplication-TileColor content="#00aba9"><meta name=msapplication-config content="/img/favicon/browserconfig.xml"><meta name=theme-color content="#ffffff"><meta charset=utf-8><meta content="utf-8" http-equiv=encoding><meta name=twitter:card content="summary"><meta name=twitter:title content="Improved i/o in anndata 0.12"><meta name=twitter:description content="With zarr v3 support and xarray integration, anndata takes a big step forward when it comes to i/o tasks."><meta property="og:url" content="https://scverse.org/blog/2025-anndata-012/"><meta property="og:site_name" content="scverse"><meta property="og:title" content="Improved i/o in anndata 0.12"><meta property="og:description" content="With zarr v3 support and xarray integration, anndata takes a big step forward when it comes to i/o tasks."><meta property="og:locale" content="en_us"><meta property="og:type" content="article"><meta property="article:section" content="blog"><meta property="article:published_time" content="2025-07-29T10:30:00+01:00"><meta property="article:modified_time" content="2025-07-29T10:30:00+01:00"><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><script src=/main.js async></script><script src=/bootstrap/js/bootstrap.bundle.min.js async></script><script data-goatcounter=https://scverse.goatcounter.com/count async src=//gc.zgo.at/count.js></script></head><body><header><div class=container style=max-width:850px><nav class="navbar navbar-expand-lg navbar-light"><div class=container-fluid><a class="navbar-brand row align-items-center m-0" href=/><div id=scverse-logo class=col></div><span class=visually-hidden>scverse</span>
2+
</a><button class=navbar-toggler type=button data-bs-toggle=collapse data-bs-target=#navbarSupportedContent aria-controls=navbarSupportedContent aria-expanded=false aria-label="Toggle navigation">
3+
<span class=navbar-toggler-icon></span></button><div class="collapse navbar-collapse justify-content-end" id=navbarSupportedContent><ul class="navbar-nav mb-2 mb-lg-0 nav-buttons"><li class="nav-item dropdown"><a class="nav-link dropdown-toggle" href=/packages id=packages-dropdown role=button aria-expanded=false>Packages</a><ul class=dropdown-menu aria-labelledby=packages-dropdown><li><a class=dropdown-item href=/packages#core-packages>Core</a></li><li><a class=dropdown-item href=/packages/#ecosystem>Ecosystem</a></li></ul></li><li class=nav-item><a class=nav-link href=/learn>Learn</a></li><li class=nav-item><a class=nav-link href=/people>People</a></li><li class=nav-item><a class="nav-link
4+
active" href=/blog>Blog</a></li><li class=nav-item><a class=nav-link href=/events>Events</a></li><li class="nav-item dropdown"><a class="nav-link dropdown-toggle" href=/about id=about-dropdown role=button aria-expanded=false>About</a><ul class=dropdown-menu aria-labelledby=about-dropdown><li><a class=dropdown-item href=/about>About scverse</a></li><li><a class=dropdown-item href=/about/mission>Mission statement</a></li><li><a class=dropdown-item href=/about/roles>Roles</a></li><li><a class=dropdown-item href=/about/code_of_conduct>Code of Conduct</a></li><li><a class=dropdown-item href=/join>Contact</a></li></ul></li><li class=nav-item><a id=join-button class="nav-link nav-button-hl" href=/join>Join</a></li></ul></div></div></nav></div></header><div id=wrapper><div id=content><div id=page-content><article class=post><h1 class=post-title>Improved i/o in anndata 0.12</h1><div class=post-subtitle><span class=post-date>July 29, 2025</span><div class=rss-icon><a href=/blog/index.xml><svg viewBox="0 0 20 20"><path d="M5 3a1 1 0 000 2c5.523.0 10 4.477 10 10a1 1 0 102 0C17 8.373 11.627 3 5 3z"/><path d="M4 9a1 1 0 011-1 7 7 0 017 7 1 1 0 11-2 0 5 5 0 00-5-5A1 1 0 014 9zM3 15a2 2 0 114 0 2 2 0 01-4 0z"/></svg></a></div></div><span class=post-author>Ilan Gold</span><div class=post-content><h1 id=012-released>0.12 released</h1><p>We&rsquo;re happy to announce that <code>anndata</code> 0.12 is out now!
5+
Check out <a href=https://anndata.readthedocs.io/en/stable/release-notes/index.html#v0-12-0>the changelog</a> for a full list of changes.
6+
Here, we want to give our users a bit of a deep dive into the new functionality.
7+
We have lots of great features, like zarr v3 support (package and format), full lazy loading, and new API customisability! Let’s dive in!</p><h2 id=zarr-v3>Zarr v3</h2><p><a href=https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html>Zarr v3 as a file format</a> provides improved cloud support, support for sharding to reduce the number of files created in a zarr store, and improved support for extensibility.
8+
Check out the following graphic from the zarr docs:
9+
By grouping chunks into shards, which are the individual file units, we can cut down the number of files a given zarr store has.
10+
Compare this to zarr v2 where every chunk was its own file!
11+
No more file system slowdowns, you can create large zarr stores with no concerns while still retaining the ease of use of zarr.</p><img src=https://zarr.dev/zeps/assets/images/sharding.png style=max-width:100% alt="zarr v3 sharding graphic"><p><a href=https://zarr.readthedocs.io/en/stable/index.html>The zarr v3 package</a>, on top of the new format, provides a fully concurrent + parallel backend for faster cloud and local access over v2, which was both single-threaded and synchronous.
12+
Thus, the new zarr v3 package on its own should provide a nice speedup, but if that’s not enough, various components are also extendable/replaceable.</p><p>Want faster cloud access? Try <a href=https://zarr.readthedocs.io/en/latest/user-guide/storage.html#object-store>obstore</a> integration for rust-accelerated remote file access
13+
What about faster local reads? Many very small chunks inside shards can be taxing for the current pure-python zarr v3 pipeline.
14+
Thus scverse core developers Philipp Angerer and Ilan Gold together with Lachlan Deakin at ANU co-developed <a href=https://zarrs-python.readthedocs.io/en/latest/>the zarrs-python package</a> for a python bridge to rust-based io acceleration from Lahclan’s zarrs package.
15+
This acceleration really shines with small, heavily sharded stores! Want to try out direct-to-gpu io? kvikio has <a href=https://docs.rapids.ai/api/kvikio/nightly/zarr/#zarr-python-3-x>a store for that</a>, with a direct-to-GPU zstd codec is coming soon as well! And if all of these new functionalities are a lot to take in, we made <a href=https://anndata.readthedocs.io/en/stable/tutorials/zarr-v3.html>a digestible guide</a> just for you.</p><p>And of course, all of this new functionality has not broken our backwards compatibility.
16+
Anndata 0.12 is still fully zarr v2 compatible, both with the package and the file format.
17+
Upgrade fearlessly!</p><h2 id=fully-lazy-file-access>Fully lazy file access</h2><p>Moving on, we have also replaced <code>anndata.experimental.read_elem_as_dask</code> with <a href=https://anndata.readthedocs.io/en/stable/generated/anndata.experimental.read_lazy.html><code>anndata.experimental.read_elem_lazy</code></a> and <a href=https://anndata.readthedocs.io/en/stable/generated/anndata.experimental.read_elem_lazy.html><code>anndata.experimental.read_lazy</code></a>.
18+
Why? Because now your dataframes can be lazy too thanks to support from <a href=https://docs.xarray.dev/en/stable/user-guide/index.html>xarray</a>!</p><p>Now you can instantly and lazily inspect entire anndata stores both locally and remotely for metadata, and then fetch only subsets you need.
19+
Mix this with zarr v3 for performant, fully lazy, fully remote (if needed) access! Want to create a new virtual in-memory anndata objects from many disparate on-disk stores? This new functionality is fully compatible with <a href=https://anndata.readthedocs.io/en/latest/generated/anndata.concat.html><code>anndata.concat</code></a>.</p><p>Check out <a href=https://anndata.readthedocs.io/en/stable/tutorials/notebooks/read_lazy.html>our notebook</a> to learn more about the API – thanks to <a href=https://hidivelab.org/>Nils Gehlenborg’s HIDIVE lab</a> for hosting the data, and be sure to check out the <a href=https://tinyurl.com/jtan4nx7>Vitessce visualisation</a> of the very same data backing the notebook.
20+
This dual-access really showcases the power of smart remote data access!</p><h2 id=customizable-api>Customizable API</h2><p>And if that wasn’t enough, we now have <a href=https://anndata.readthedocs.io/en/latest/generated/anndata.register_anndata_namespace.html>a new way of extending the anndata API</a> contributed by one of our community members, Sri Varra.
21+
This contribution lets users extend the <code>AnnData</code> API easily, great for tinkering with new APIs and features but also for writing new methods directly into the <code>AnnData</code> object:</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-python data-lang=python><span style=display:flex><span><span style=color:#f92672>import</span> anndata <span style=color:#66d9ef>as</span> ad
22+
</span></span><span style=display:flex><span>
23+
</span></span><span style=display:flex><span><span style=color:#a6e22e>@ad.register_anndata_namespace</span>(<span style=color:#e6db74>&#34;my_accessor&#34;</span>)
24+
</span></span><span style=display:flex><span><span style=color:#66d9ef>class</span> <span style=color:#a6e22e>Greetings</span>:
25+
</span></span><span style=display:flex><span> <span style=color:#66d9ef>def</span> <span style=color:#a6e22e>__init__</span>(self, adata: ad<span style=color:#f92672>.</span>AnnData):
26+
</span></span><span style=display:flex><span> self<span style=color:#f92672>.</span>_adata <span style=color:#f92672>=</span> adata
27+
</span></span><span style=display:flex><span>
28+
</span></span><span style=display:flex><span> <span style=color:#66d9ef>def</span> <span style=color:#a6e22e>greet</span>():
29+
</span></span><span style=display:flex><span> <span style=color:#66d9ef>return</span> <span style=color:#e6db74>&#34;hi&#34;</span>
30+
</span></span><span style=display:flex><span>
31+
</span></span><span style=display:flex><span><span style=color:#75715e># and to use</span>
32+
</span></span><span style=display:flex><span>
33+
</span></span><span style=display:flex><span>adata<span style=color:#f92672>.</span>my_accessor<span style=color:#f92672>.</span>greet()
34+
</span></span></code></pre></div><p>Especially as we look to a more extensible future with <a href=https://github.com/scverse/anndata/issues/1897>async access</a> and a <a href=https://github.com/scverse/anndata/issues/2043>dataframe API</a>, being able to write clean code that really fits your use-case is more important than ever.
35+
Thanks for the contribution! Please reach out on Github or Zulip if you wish to contribute to these efforts or others! We welcome community contributions and are happy to provide feedback and guidance!</p><p><em>— The scverse core team</em></p></div></article></div></div></div><footer><div id=footer-content class=container><div class=row><div class="col-12 col-md-6 col-lg-3"><h5>Pages</h5><ul class=list-unstyled><li><a href=/packages>Packages</a></li><li><a href=/learn>Learn</a></li><li><a href=/people>People</a></li><li><a href=/blog>Blog</a></li><li><a href=/events>Events</a></li><li><a href=/about>About</a></li></ul></div><div class="col-12 col-md-6 col-lg-3"><h5>Governance</h5><ul class=list-unstyled><li><a href=/about/mission/>Mission statement</a></li><li><a href=/about/code_of_conduct>Code of conduct</a></li><li><a href=/about/roles>Roles</a></li></ul></div><div class="col-12 col-md-6 col-lg-3"><h5>Join scverse</h5><ul class=list-unstyled><li><a href=https://github.com/scverse target=_blank>GitHub</a></li><li><a href=https://discourse.scverse.org/ target=_blank>Discourse</a></li><li><a href=https://scverse.zulipchat.com/ target=_blank>Zulip</a></li><li><a href=https://x.com/scverse_team target=_blank>X (Twitter)</a></li><li><a href=https://bsky.app/profile/scverse.bsky.social target=_blank>Bluesky</a></li><li><a href=https://www.youtube.com/channel/UCpsvsIAW3R5OdftJKKuLNMA target=_blank>YouTube</a></li></ul></div></div><div class=signature><p>scverse® core team, 2025</p></div></div></footer></body></html>

0 commit comments

Comments
 (0)