Skip to content

feat: mlx compat#2334

Draft
ilan-gold wants to merge 4 commits intomainfrom
ig/mlx_compat
Draft

feat: mlx compat#2334
ilan-gold wants to merge 4 commits intomainfrom
ig/mlx_compat

Conversation

@ilan-gold
Copy link
Copy Markdown
Contributor

@ilan-gold ilan-gold commented Feb 6, 2026

TODOs:

Felt excited after the announcement, wanted to give it a spin

  • Closes #
  • Tests added
  • Release note not necessary because:

@ilan-gold ilan-gold added this to the 0.13.0 milestone Feb 6, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 6, 2026

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
14 3 11 1
View the top 3 failed test(s) by shortest run time
tests.test_readwrite::test_readwrite_kitchensink[dataset_kwargs0-mlx-zarr]
Stack Traces | 0.004s run time
tmp_path = PosixPath('.../pytest-0/popen-gw0/test_readwrite_kitchensink_dat2')
storage = 'zarr', typ = <function mlx_array_or_idempotent at 0x7fe6ef384e00>
backing_h5ad = PosixPath('.../pytest-0/popen-gw0/test_readwrite_kitchensink_dat2/test.h5ad')
dataset_kwargs = {}

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mstorage#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mtyp#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, ARRAY_TYPES)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_readwrite_kitchensink#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        tmp_path: Path,#x1B[90m#x1B[39;49;00m
        storage: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        typ,#x1B[90m#x1B[39;49;00m
        backing_h5ad: Path,#x1B[90m#x1B[39;49;00m
        dataset_kwargs,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        X = typ(X_list)#x1B[90m#x1B[39;49;00m
        adata_src = ad.AnnData(X, obs=obs_dict, var=var_dict, uns=uns_dict)#x1B[90m#x1B[39;49;00m
        #x1B[94massert#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(adata_src.obs[#x1B[33m"#x1B[39;49;00m#x1B[33moanno1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m].dtype, pd.CategoricalDtype)#x1B[90m#x1B[39;49;00m
>       adata_src.raw = adata_src.copy()#x1B[90m#x1B[39;49;00m
                        ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_readwrite.py#x1B[0m:182: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:1557: in copy
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._mutated_copy()#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = AnnData object with n_obs × n_vars = 3 × 2
    obs: 'oanno1', 'oanno1b', 'oanno1c', 'oanno2', 'oanno3', 'oanno4'
    var: 'vanno1', 'vanno2', 'vanno3', 'vanno4'
    uns: 'oanno1_colors', 'uns2', 'uns3', 'uns4', 'uns5'
kwargs = {}
new = {'layers': {}, 'obs':       oanno1 oanno1b oanno1c oanno2  oanno3  oanno4
name1   cat1    cat1    cat1     o1     2.1 ...  cat1    cat1     o2     2.2     1.1
name3   cat2    cat1     NaN     o3     2.3     2.2, 'obsm': {}, 'obsp': {}, ...}
key = 'layers'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_mutated_copy#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, **kwargs):#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Creating AnnData with attributes optionally specified via kwargs."""#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.isbacked #x1B[95mand#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mX#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[95min#x1B[39;49;00m kwargs #x1B[95mor#x1B[39;49;00m (#x1B[96mself#x1B[39;49;00m.raw #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mraw#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[95min#x1B[39;49;00m kwargs)#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
            msg = (#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mThis function does not currently handle backed objects #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33minternally, this should be dealt with before.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mNotImplementedError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
        new = {}#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mfor#x1B[39;49;00m key #x1B[95min#x1B[39;49;00m [#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsp#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarp#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mlayers#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]:#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m key #x1B[95min#x1B[39;49;00m kwargs:#x1B[90m#x1B[39;49;00m
                new[key] = kwargs[key]#x1B[90m#x1B[39;49;00m
            #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                new[key] = #x1B[96mgetattr#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, key).copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mX#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95min#x1B[39;49;00m kwargs:#x1B[90m#x1B[39;49;00m
            new[#x1B[33m"#x1B[39;49;00m#x1B[33mX#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = kwargs[#x1B[33m"#x1B[39;49;00m#x1B[33mX#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._has_X():#x1B[90m#x1B[39;49;00m
>           new[#x1B[33m"#x1B[39;49;00m#x1B[33mX#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = #x1B[96mself#x1B[39;49;00m.X.copy()#x1B[90m#x1B[39;49;00m
                       ^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: 'mlx.core.array' object has no attribute 'copy'#x1B[0m

#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:1489: AttributeError
tests.test_readwrite::test_readwrite_kitchensink[dataset_kwargs1-mlx-zarr]
Stack Traces | 0.006s run time
tmp_path = PosixPath('.../pytest-0/popen-gw0/test_readwrite_kitchensink_dat0')
storage = 'zarr', typ = <function mlx_array_or_idempotent at 0x7fe6ef384e00>
backing_h5ad = PosixPath('.../pytest-0/popen-gw0/test_readwrite_kitchensink_dat0/test.h5ad')
dataset_kwargs = {'compression': 'gzip'}

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mstorage#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, [#x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m])#x1B[90m#x1B[39;49;00m
    #x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[33m"#x1B[39;49;00m#x1B[33mtyp#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, ARRAY_TYPES)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_readwrite_kitchensink#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        tmp_path: Path,#x1B[90m#x1B[39;49;00m
        storage: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mh5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mzarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        typ,#x1B[90m#x1B[39;49;00m
        backing_h5ad: Path,#x1B[90m#x1B[39;49;00m
        dataset_kwargs,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        X = typ(X_list)#x1B[90m#x1B[39;49;00m
        adata_src = ad.AnnData(X, obs=obs_dict, var=var_dict, uns=uns_dict)#x1B[90m#x1B[39;49;00m
        #x1B[94massert#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(adata_src.obs[#x1B[33m"#x1B[39;49;00m#x1B[33moanno1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m].dtype, pd.CategoricalDtype)#x1B[90m#x1B[39;49;00m
>       adata_src.raw = adata_src.copy()#x1B[90m#x1B[39;49;00m
                        ^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_readwrite.py#x1B[0m:182: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:1557: in copy
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._mutated_copy()#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = AnnData object with n_obs × n_vars = 3 × 2
    obs: 'oanno1', 'oanno1b', 'oanno1c', 'oanno2', 'oanno3', 'oanno4'
    var: 'vanno1', 'vanno2', 'vanno3', 'vanno4'
    uns: 'oanno1_colors', 'uns2', 'uns3', 'uns4', 'uns5'
kwargs = {}
new = {'layers': {}, 'obs':       oanno1 oanno1b oanno1c oanno2  oanno3  oanno4
name1   cat1    cat1    cat1     o1     2.1 ...  cat1    cat1     o2     2.2     1.1
name3   cat2    cat1     NaN     o3     2.3     2.2, 'obsm': {}, 'obsp': {}, ...}
key = 'layers'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_mutated_copy#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, **kwargs):#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Creating AnnData with attributes optionally specified via kwargs."""#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.isbacked #x1B[95mand#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33mX#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[95min#x1B[39;49;00m kwargs #x1B[95mor#x1B[39;49;00m (#x1B[96mself#x1B[39;49;00m.raw #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mraw#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[95min#x1B[39;49;00m kwargs)#x1B[90m#x1B[39;49;00m
        ):#x1B[90m#x1B[39;49;00m
            msg = (#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mThis function does not currently handle backed objects #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33minternally, this should be dealt with before.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mNotImplementedError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
        new = {}#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mfor#x1B[39;49;00m key #x1B[95min#x1B[39;49;00m [#x1B[33m"#x1B[39;49;00m#x1B[33mobs#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarm#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mobsp#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mvarp#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mlayers#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]:#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m key #x1B[95min#x1B[39;49;00m kwargs:#x1B[90m#x1B[39;49;00m
                new[key] = kwargs[key]#x1B[90m#x1B[39;49;00m
            #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                new[key] = #x1B[96mgetattr#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, key).copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mX#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95min#x1B[39;49;00m kwargs:#x1B[90m#x1B[39;49;00m
            new[#x1B[33m"#x1B[39;49;00m#x1B[33mX#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = kwargs[#x1B[33m"#x1B[39;49;00m#x1B[33mX#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._has_X():#x1B[90m#x1B[39;49;00m
>           new[#x1B[33m"#x1B[39;49;00m#x1B[33mX#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = #x1B[96mself#x1B[39;49;00m.X.copy()#x1B[90m#x1B[39;49;00m
                       ^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: 'mlx.core.array' object has no attribute 'copy'#x1B[0m

#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:1489: AttributeError
tests.test_readwrite::test_readwrite_equivalent_h5ad_zarr[mlx]
Stack Traces | 0.045s run time
tmp_path = PosixPath('.../pytest-0/popen-gw1/test_readwrite_equivalent_h5ad1')
typ = <function mlx_array_or_idempotent at 0x7f1ce676ce00>

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.parametrize(#x1B[90m#x1B[39;49;00m
        #x1B[33m"#x1B[39;49;00m#x1B[33mtyp#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        [#x1B[90m#x1B[39;49;00m
            pytest.param(np.array, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mnp.array#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(csr_matrix, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mcsr_matrix#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(csc_matrix, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mcsc_matrix#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(csr_array, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mcsr_array#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(csc_array, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mcsc_array#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            pytest.param(#x1B[90m#x1B[39;49;00m
                jnp_array_or_idempotent, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mjax.array#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, marks=pytest.mark.array_api#x1B[90m#x1B[39;49;00m
            ),#x1B[90m#x1B[39;49;00m
            pytest.param(mlx_array_or_idempotent, #x1B[96mid#x1B[39;49;00m=#x1B[33m"#x1B[39;49;00m#x1B[33mmlx#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, marks=pytest.mark.array_api),#x1B[90m#x1B[39;49;00m
        ],#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_readwrite_equivalent_h5ad_zarr#x1B[39;49;00m(tmp_path: Path, typ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        h5ad_pth = tmp_path / #x1B[33m"#x1B[39;49;00m#x1B[33madata.h5ad#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        zarr_pth = tmp_path / #x1B[33m"#x1B[39;49;00m#x1B[33madata.zarr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        M, N = #x1B[94m100#x1B[39;49;00m, #x1B[94m101#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        adata = gen_adata((M, N), X_type=typ, **GEN_ADATA_NO_XARRAY_ARGS)#x1B[90m#x1B[39;49;00m
>       adata.raw = adata.copy()#x1B[90m#x1B[39;49;00m
                    ^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_readwrite.py#x1B[0m:306: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:1557: in copy
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._mutated_copy()#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../anndata/_core/anndata.py#x1B[0m:1485: in _mutated_copy
    #x1B[0mnew[key] = #x1B[96mgetattr#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, key).copy()#x1B[90m#x1B[39;49;00m
               ^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PairwiseArrays with keys: array, sparse, sparse_array

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mcopy#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m) -> #x1B[96mdict#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, Value]:#x1B[90m#x1B[39;49;00m
        #x1B[90m# Shallow copy for awkward array since their buffers are immutable#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mreturn#x1B[39;49;00m {#x1B[90m#x1B[39;49;00m
>           k: copy(v) #x1B[94mif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(v, AwkArray) #x1B[94melse#x1B[39;49;00m v.copy() #x1B[94mfor#x1B[39;49;00m k, v #x1B[95min#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.items()#x1B[90m#x1B[39;49;00m
                                                       ^^^^^^#x1B[90m#x1B[39;49;00m
        }#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       AttributeError: 'mlx.core.array' object has no attribute 'copy'#x1B[0m

#x1B[1m#x1B[.../anndata/_core/aligned_mapping.py#x1B[0m:122: AttributeError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant