Skip to content

feat: support acc shortcuts - #4288

Open
flying-sheep wants to merge 3 commits into
mainfrom
acc-shortcuts
Open

feat: support acc shortcuts#4288
flying-sheep wants to merge 3 commits into
mainfrom
acc-shortcuts

Conversation

@flying-sheep

@flying-sheep flying-sheep commented Aug 11, 2026

Copy link
Copy Markdown
Member

scanpy.get.aggregate already handles them, but the plotting functions didn’t yet.

  • Closes #
  • Tests included or not required because:

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

❌ 16 Tests Failed:

Tests completed Failed Passed Skipped
2970 16 2954 165
View the top 3 failed test(s) by shortest run time
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency[bw]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency[crop]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency[img]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency[na_color.lightgray]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency[na_color.transparent]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency[size:.5]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency[size:2]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency[spotsize]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency_no_img[bw]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency_no_img[crop]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency_no_img[img]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency_no_img[na_color.lightgray]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency_no_img[na_color.transparent]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency_no_img[size:.5]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency_no_img[size:2]
Stack Traces | 0.001s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: AttributeError
tests/plotting/legacy/embedded/test_spatial.py::test_manual_equivalency_no_img[spotsize]
Stack Traces | 0.113s run time
adata = AnnData object with n_obs × n_vars = 2600 × 20
    obs: 'label', 'label_missing', '1_missing'
    uns: 'spatial', 'pca'
    obsm: 'spatial', 'pca'
    varm: 'pca'
    layers: None (.X)

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture(scope=#x1B[33m"#x1B[39;49;00m#x1B[33mmodule#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mequivalent_spatial_plotters#x1B[39;49;00m(adata):#x1B[90m#x1B[39;49;00m
        no_spatial = adata.copy()#x1B[90m#x1B[39;49;00m
        #x1B[94mdel#x1B[39;49;00m no_spatial.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        img_key = #x1B[33m"#x1B[39;49;00m#x1B[33mhires#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        library_id = #x1B[96mnext#x1B[39;49;00m(#x1B[96miter#x1B[39;49;00m(adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]))#x1B[90m#x1B[39;49;00m
        spatial_data = adata.uns[#x1B[33m"#x1B[39;49;00m#x1B[33mspatial#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][library_id]#x1B[90m#x1B[39;49;00m
        img = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mimages#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][img_key]#x1B[90m#x1B[39;49;00m
        scale_factor = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mtissue_#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mimg_key#x1B[33m}#x1B[39;49;00m#x1B[33m_scalef#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
        spot_size = spatial_data[#x1B[33m"#x1B[39;49;00m#x1B[33mscalefactors#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m][#x1B[33m"#x1B[39;49;00m#x1B[33mspot_diameter_fullres#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m]#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       orig_plotter = partial(sc.pl.spatial, adata, color=#x1B[33m"#x1B[39;49;00m#x1B[33m1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, show=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                               ^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[.../legacy/embedded/test_spatial.py#x1B[0m:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'spatial'

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m__getattr__#x1B[39;49;00m(name: #x1B[96mstr#x1B[39;49;00m) -> Any:#x1B[90m#x1B[39;49;00m
        #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mscanpy#x1B[39;49;00m#x1B[04m#x1B[96m.#x1B[39;49;00m#x1B[04m#x1B[96m_settings#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mimport#x1B[39;49;00m Preset, settings#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _backend = _v2_module() #x1B[94mif#x1B[39;49;00m settings.preset #x1B[95mis#x1B[39;49;00m Preset.ScanpyV2Preview #x1B[94melse#x1B[39;49;00m legacy#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mgetattr#x1B[39;49;00m(_backend, name)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mmodule #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mscanpy.plotting#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m has no attribute #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mname#x1B[33m!r}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAttributeError#x1B[39;49;00m(msg) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AttributeError: module 'scanpy.plotting' has no attribute 'spatial'#x1B[0m

#x1B[1m#x1B[.../scanpy/plotting/__init__.py#x1B[0m:41: 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.

@flying-sheep flying-sheep added this to the 1.13.0 milestone Aug 11, 2026

@selmanozleyen selmanozleyen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
this looks nice but if we want to ensure people use the accessors why do we allow strings then? Because I think there are some problems with the string format I'd like to mention first. I know it's not entirely in the scope of this PR but since we are exposing it here I find it relevant.

Also since the checks in the str format isn't robust and complete it might cause some confusion in scanpy. One more comment on . as the separator. I know that seurat v5 uses . uses it as a separator for example like layers[counts.sample1]

Comment thread src/scanpy/plotting/_v2/_core.py
Comment thread src/scanpy/plotting/_v2/_core.py
@flying-sheep

Copy link
Copy Markdown
Member Author

if we want to ensure people use the accessors why do we allow strings then

@timtreis and others seem to feel strong about it …

@flying-sheep

flying-sheep commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

TODO: think about shortcuts and dataframes: obsm.foo.bar.baz ambiguity: A.obsm["foo.bar.baz"]? A.obsm["foo.bar"].loc[:, "baz"]? A.obsm["foo"].loc[:, "bar.baz"]

Maybe just ban dots in keys?

@flying-sheep flying-sheep self-assigned this Aug 31, 2026
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.

2 participants