anndata_memory/
lib.rs

1mod ad;
2mod base;
3mod converter;
4pub(crate) mod utils;
5pub(crate) mod chunked_loader;
6pub(crate) mod optimized_loader;
7mod loader;
8mod concat;
9
10pub use ad::IMAnnData;
11pub use ad::helpers::IMArrayElement;
12pub use ad::helpers::IMDataFrameElement;
13pub use ad::helpers::IMElementCollection;
14pub use ad::helpers::IMElement;
15pub use ad::helpers::IMAxisArrays;
16pub use converter::convert_to_in_memory;
17pub use converter::convert_to_backed;
18pub use converter::convert_to_new_backed_h5;
19pub use base::DeepClone;
20
21
22
23#[derive(Clone, Debug)]
24pub enum LoadingStrategy {
25    Auto,           
26    ForceComplete,  
27    ForceChunked, 
28}
29
30#[derive(Clone, Debug)]
31pub struct LoadingConfig {
32    pub loading_strategy: LoadingStrategy,  
33    pub chunk_size_mb: usize,
34    pub memory_threshold_mb: usize,
35    pub show_progress: bool,
36}
37
38impl Default for LoadingConfig {
39    fn default() -> Self {
40        Self {
41            loading_strategy: LoadingStrategy::Auto, 
42            chunk_size_mb: 100,
43            memory_threshold_mb: 1024,
44            show_progress: true,
45        }
46    }
47}
48
49#[derive(Clone, Debug)]
50pub enum ConcatStrategy {
51    ConcatObs,
52    ConcatVars,
53    Union,
54    Intersection
55}
56
57pub use loader::{load_h5ad, load_h5ad_fast, load_h5ad_conservative, load_h5ad_with_config};