Skip to content

Commit c6a19c6

Browse files
authored
Merge pull request #8 from SingleRust/feature-dev-load-speedup
Added concat framework, still work in progress
2 parents 1b59a6f + 3eab8df commit c6a19c6

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "anndata-memory"
3-
version = "1.0.5"
3+
version = "1.0.6"
44
edition = "2021"
55
readme = "README.md"
66
repository = "https://github.com/SingleRust/Anndata-Memory"

src/concat/csr.rs

Whitespace-only changes.

src/concat/mod.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
use std::path::Path;
2+
3+
use crate::{ConcatStrategy, LoadingStrategy};
4+
5+
pub(crate) mod csr;
6+
7+
// TODO!
8+
9+
10+
pub fn concat_datasets_backed_to_memory<P: AsRef<Path>>(paths: &[P], load_strategy: Option<LoadingStrategy>, merge_strategy: Option<ConcatStrategy>) {
11+
12+
// general approach have dataset:
13+
// 1. collect statistics: ensure all datasets have same datatype (for sparse datatypes collect num rows, num cols, nnz)
14+
// 2. delegate to CSR, CSC datatype
15+
// 3. load sequentially one dataset after another, if chunked approach, use anndata-rs to handle chunking 0
16+
17+
18+
19+
20+
21+
}
22+
23+

src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pub(crate) mod utils;
55
pub(crate) mod chunked_loader;
66
pub(crate) mod optimized_loader;
77
mod loader;
8+
mod concat;
89

910
pub use ad::IMAnnData;
1011
pub use ad::helpers::IMArrayElement;
@@ -17,6 +18,8 @@ pub use converter::convert_to_backed;
1718
pub use converter::convert_to_new_backed_h5;
1819
pub use base::DeepClone;
1920

21+
22+
2023
#[derive(Clone, Debug)]
2124
pub enum LoadingStrategy {
2225
Auto,
@@ -43,4 +46,12 @@ impl Default for LoadingConfig {
4346
}
4447
}
4548

49+
#[derive(Clone, Debug)]
50+
pub enum ConcatStrategy {
51+
ConcatObs,
52+
ConcatVars,
53+
Union,
54+
Intersection
55+
}
56+
4657
pub use loader::{load_h5ad, load_h5ad_fast, load_h5ad_conservative, load_h5ad_with_config};

0 commit comments

Comments
 (0)