question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Alignment with xarray

See original GitHub issue

I’m opening this issue to track and discuss how our data structure differs from xarray. Ideally I would close it when AnnData could easily be implemented via xarray.

Some previous discussion: #308

The idea

I often think of AnnData as a kind of “special case” of xarray Datasets. We just improve convenience by specializing on the 2d case, plus a few other features. It would be nice if I didn’t just think of it that way, and we could actually just use their code here.

sgkit basically accomplishes this. It basically uses a very “anndata shaped”[^1] xarray Dataset[^2] for representing genomics data. These data structures and our goals with them are so similar that searching for open issues by the sgkit devs on the xarray repository is a great way to find compatibility issues for anndata.

Additionally, zarr and OME-zarr are quite aligned with xarray. (TODO: expand with context here)

What’s missing

Some things we need, which xarray does not currently provide:

[^1]: Since we’re in the same language, working with biological data, and using many of the same technologies it would make a lot of sense for us to have greater alignment with sgkit. [^2]: More context: https://github.com/single-cell-data/matrix-api/issues/11#issuecomment-1072533371

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jpivarskicommented, Apr 6, 2022

Bit of a tangent, but it might be worthwhile to write up a Data Array API issue about the Awkward Array use case.

We already talked about it here: https://github.com/data-apis/consortium-feedback/discussions/6. It sounded pretty clear that Awkward (and by extension, Arrow) are out of scope for Data Array API, and it’s understandable that the scope would have to cut off somewhere.

0reactions
SimonHeybrockcommented, Jun 8, 2022

@ivirshup The two things you point out (holding other Python arrays, dask support) are indeed somewhat sore points for us. We would like to do both, but currently have no funding to do so.

We have serialization compatible with dask, so a number of the dask multi-processing APIs can be used, but we do not have an implementation of the dask collections interface, i.e., we currently do not support chunking and operations in the style of xarray’s dask support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

xarray.align
Given any number of Dataset and/or DataArray objects, returns new objects with aligned indexes and dimension sizes. Array from the aligned objects are...
Read more >
xarray.align — xarray 0.12.3 documentation
Given any number of Dataset and/or DataArray objects, returns new objects with aligned indexes and dimension sizes. Array from the aligned objects are...
Read more >
Alignment and Preprocessing — EarthML 0.2.1 documentation
Once the data is made available as detailed in Data Ingestion, the next step is to ensure the data has been appropriately reshaped...
Read more >
How to align xarray DataArray with length-1 dimension with a ...
Short answer, squeeze the data so xarray's automatic alignment rules kick in: da = da.squeeze(dim='time', drop=True).
Read more >
xarray/alignment.py at main - GitHub
"""Normalize the indexes/indexers used for re-indexing or alignment. Return dictionaries of xarray Index objects and coordinate variables. such that we can ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found