Skip to content

Commit 1391e9e

Browse files
small updates for zarrv3 branch (#374)
* simplify conditional * small changes for zarrv3 spatialdata * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 8db31af commit 1391e9e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/napari_spatialdata/_viewer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from spatialdata import get_element_annotators, get_element_instances
1919
from spatialdata._core.query.relational_query import _left_join_spatialelement_table
2020
from spatialdata._types import ArrayLike
21-
from spatialdata.models import PointsModel, ShapesModel, TableModel, force_2d, get_channels
21+
from spatialdata.models import PointsModel, ShapesModel, TableModel, force_2d, get_channel_names
2222
from spatialdata.transformations import Affine, Identity
2323

2424
from napari_spatialdata._model import DataModel
@@ -473,7 +473,7 @@ def get_sdata_image(self, sdata: SpatialData, key: str, selected_cs: str, multi:
473473
affine = _get_transform(sdata.images[original_name], selected_cs)
474474
rgb_image, rgb = _adjust_channels_order(element=sdata.images[original_name])
475475

476-
channels = ("RGB(A)",) if rgb else get_channels(sdata.images[original_name])
476+
channels = ("RGB(A)",) if rgb else get_channel_names(sdata.images[original_name])
477477

478478
adata = AnnData(shape=(0, len(channels)), var=pd.DataFrame(index=channels))
479479

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
from napari_spatialdata.utils._test_utils import export_figure, save_image
2727

28-
OFFSCREEN = os.environ.get('QT_QPA_PLATFORM', '') == 'offscreen'
28+
OFFSCREEN = os.environ.get("QT_QPA_PLATFORM", "") == "offscreen"
2929

3030
HERE: Path = Path(__file__).parent
3131

tests/test_interactive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from spatialdata.models import Image2DModel
1212

1313
from napari_spatialdata._interactive import Interactive
14-
from tests.conftest import PlotTester, PlotTesterMeta, OFFSCREEN
14+
from tests.conftest import OFFSCREEN, PlotTester, PlotTesterMeta
1515

1616
ARM_PROBLEM = (
1717
parse_version(version("numpy")) < parse_version("2") and sys.platform == "darwin" and platform.machine() == "arm64"

tests/test_widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_change_layer(
9191
sdata_blobs: SpatialData,
9292
) -> None:
9393
table = sdata_blobs["table"].copy()
94-
table.obs["region"] = "blobs_labels"
94+
table.obs["region"] = pd.Categorical(["blobs_labels"] * table.n_obs)
9595
table.uns["spatialdata_attrs"]["region"] = "blobs_labels"
9696
table.var_names = pd.Index([i + "_second" for i in table.var_names])
9797
sdata_blobs["second_table"] = table

0 commit comments

Comments
 (0)