laminlabs / lamindb

A data framework for biology.
https://docs.lamin.ai
Apache License 2.0
129 stars 12 forks source link

✨ Add n_observations function to read n_obs from AnnData and tiledbsoma #2097

Open Koncopd opened 1 month ago

Koncopd commented 1 month ago

Re https://laminlabs.slack.com/archives/C04FPE8V01W/p1726658747846539

This function infers n_obs from anndata (both zarr and hdf5) and tiledbsoma. I am reluctant to add this to Artifact by default though.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 82.35294% with 9 lines in your changes missing coverage. Please review.

Project coverage is 92.45%. Comparing base (c41fc2c) to head (523ece4). Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
lamindb/core/storage/_observations.py 82.00% 9 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2097 +/- ## ========================================== - Coverage 92.52% 92.45% -0.08% ========================================== Files 54 55 +1 Lines 6435 6480 +45 ========================================== + Hits 5954 5991 +37 - Misses 481 489 +8 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 month ago

🚀 Deployed on https://6717a6d26fce981ebb75fa95--lamindb-qnwk.netlify.app

Koncopd commented 1 month ago

Do we want it to be used by default?

falexwolf commented 1 month ago

This shouldn't be part of the Artifact API. If it's used internally while constructing the Artifact object, that's OK!

Can you more comprehensively document why this PR exists? The Slack link is internal and hence nobody external will understand why you're doing what you're doing here. ☺️

falexwolf commented 1 week ago

This looks perfectly great. We should just call this in Artifact() by default if a corresponding path is called within say from_anndata().

Koncopd commented 1 week ago

Ok, makes sense. It still needs a bit of improvement though. Should we also have .from_tiledbsoma?

falexwolf commented 1 week ago

Ok, makes sense. It still needs a bit of improvement though. Should we also have .from_tiledbsoma?

Yes, I think so!