You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!doctype html><html><head><title>Improved i/o in anndata 0.12</title><linkrel=stylesheettype=text/csshref=/bootstrap/css/bootstrap.min.css><linkrel=stylesheettype=text/csshref=/bootstrap/icons/bootstrap-icons.css><linkrel=stylesheettype=text/csshref=/main.min.css><linkrel=apple-touch-iconsizes=180x180href=/img/favicon/apple-touch-icon.png><linkrel=icontype=image/pngsizes=32x32href=/img/favicon/favicon-32x32.png><linkrel=icontype=image/pngsizes=16x16href=/img/favicon/favicon-16x16.png><linkrel=manifesthref=/img/favicon/site.webmanifest><linkrel=mask-iconhref=/img/favicon/safari-pinned-tab.svgcolor=#000000><linkrel="shortcut icon" href=/img/favicon/favicon.ico><metaname=msapplication-TileColorcontent="#00aba9"><metaname=msapplication-configcontent="/img/favicon/browserconfig.xml"><metaname=theme-colorcontent="#ffffff"><metacharset=utf-8><metacontent="utf-8" http-equiv=encoding><metaname=twitter:cardcontent="summary"><metaname=twitter:titlecontent="Improved i/o in anndata 0.12"><metaname=twitter:descriptioncontent="With zarr v3 support and xarray integration, anndata takes a big step forward when it comes to i/o tasks."><metaproperty="og:url" content="https://scverse.org/blog/2025-anndata-012/"><metaproperty="og:site_name" content="scverse"><metaproperty="og:title" content="Improved i/o in anndata 0.12"><metaproperty="og:description" content="With zarr v3 support and xarray integration, anndata takes a big step forward when it comes to i/o tasks."><metaproperty="og:locale" content="en_us"><metaproperty="og:type" content="article"><metaproperty="article:section" content="blog"><metaproperty="article:published_time" content="2025-07-29T10:30:00+01:00"><metaproperty="article:modified_time" content="2025-07-29T10:30:00+01:00"><metacharset=utf-8><metaname=viewportcontent="width=device-width,initial-scale=1"><scriptsrc=/main.jsasync></script><scriptsrc=/bootstrap/js/bootstrap.bundle.min.jsasync></script><scriptdata-goatcounter=https://scverse.goatcounter.com/countasyncsrc=//gc.zgo.at/count.js></script></head><body><header><divclass=containerstyle=max-width:850px><navclass="navbar navbar-expand-lg navbar-light"><divclass=container-fluid><aclass="navbar-brand row align-items-center m-0" href=/><divid=scverse-logoclass=col></div><spanclass=visually-hidden>scverse</span>
Check out <ahref=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><h2id=zarr-v3>Zarr v3</h2><p><ahref=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><imgsrc=https://zarr.dev/zeps/assets/images/sharding.pngstyle=max-width:100%alt="zarr v3 sharding graphic"><p><ahref=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 <ahref=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 <ahref=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 <ahref=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 <ahref=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><h2id=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 <ahref=https://anndata.readthedocs.io/en/stable/generated/anndata.experimental.read_lazy.html><code>anndata.experimental.read_elem_lazy</code></a> and <ahref=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 <ahref=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 <ahref=https://anndata.readthedocs.io/en/latest/generated/anndata.concat.html><code>anndata.concat</code></a>.</p><p>Check out <ahref=https://anndata.readthedocs.io/en/stable/tutorials/notebooks/read_lazy.html>our notebook</a> to learn more about the API – thanks to <ahref=https://hidivelab.org/>Nils Gehlenborg’s HIDIVE lab</a> for hosting the data, and be sure to check out the <ahref=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><h2id=customizable-api>Customizable API</h2><p>And if that wasn’t enough, we now have <ahref=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><divclass=highlight><pretabindex=0style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><codeclass=language-pythondata-lang=python><spanstyle=display:flex><span><spanstyle=color:#f92672>import</span> anndata <spanstyle=color:#66d9ef>as</span> ad
</span></span></code></pre></div><p>Especially as we look to a more extensible future with <ahref=https://github.com/scverse/anndata/issues/1897>async access</a> and a <ahref=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><divid=footer-contentclass=container><divclass=row><divclass="col-12 col-md-6 col-lg-3"><h5>Pages</h5><ulclass=list-unstyled><li><ahref=/packages>Packages</a></li><li><ahref=/learn>Learn</a></li><li><ahref=/people>People</a></li><li><ahref=/blog>Blog</a></li><li><ahref=/events>Events</a></li><li><ahref=/about>About</a></li></ul></div><divclass="col-12 col-md-6 col-lg-3"><h5>Governance</h5><ulclass=list-unstyled><li><ahref=/about/mission/>Mission statement</a></li><li><ahref=/about/code_of_conduct>Code of conduct</a></li><li><ahref=/about/roles>Roles</a></li></ul></div><divclass="col-12 col-md-6 col-lg-3"><h5>Join scverse</h5><ulclass=list-unstyled><li><ahref=https://github.com/scversetarget=_blank>GitHub</a></li><li><ahref=https://discourse.scverse.org/target=_blank>Discourse</a></li><li><ahref=https://scverse.zulipchat.com/target=_blank>Zulip</a></li><li><ahref=https://x.com/scverse_teamtarget=_blank>X (Twitter)</a></li><li><ahref=https://bsky.app/profile/scverse.bsky.socialtarget=_blank>Bluesky</a></li><li><ahref=https://www.youtube.com/channel/UCpsvsIAW3R5OdftJKKuLNMAtarget=_blank>YouTube</a></li></ul></div></div><divclass=signature><p>scverse® core team, 2025</p></div></div></footer></body></html>
0 commit comments