diff --git a/src/napari_spatialdata/_viewer.py b/src/napari_spatialdata/_viewer.py index 2a253a3b..c6af7139 100644 --- a/src/napari_spatialdata/_viewer.py +++ b/src/napari_spatialdata/_viewer.py @@ -18,7 +18,7 @@ from spatialdata import get_element_annotators, get_element_instances from spatialdata._core.query.relational_query import _left_join_spatialelement_table from spatialdata._types import ArrayLike -from spatialdata.models import PointsModel, ShapesModel, TableModel, force_2d, get_channels +from spatialdata.models import PointsModel, ShapesModel, TableModel, force_2d, get_channel_names from spatialdata.transformations import Affine, Identity from napari_spatialdata._model import DataModel @@ -473,7 +473,7 @@ def get_sdata_image(self, sdata: SpatialData, key: str, selected_cs: str, multi: affine = _get_transform(sdata.images[original_name], selected_cs) rgb_image, rgb = _adjust_channels_order(element=sdata.images[original_name]) - channels = ("RGB(A)",) if rgb else get_channels(sdata.images[original_name]) + channels = ("RGB(A)",) if rgb else get_channel_names(sdata.images[original_name]) adata = AnnData(shape=(0, len(channels)), var=pd.DataFrame(index=channels)) diff --git a/tests/conftest.py b/tests/conftest.py index cc123e65..d94fc69c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,7 +25,7 @@ from napari_spatialdata.utils._test_utils import export_figure, save_image -OFFSCREEN = os.environ.get('QT_QPA_PLATFORM', '') == 'offscreen' +OFFSCREEN = os.environ.get("QT_QPA_PLATFORM", "") == "offscreen" HERE: Path = Path(__file__).parent diff --git a/tests/test_interactive.py b/tests/test_interactive.py index ddc25b5d..a884ed39 100644 --- a/tests/test_interactive.py +++ b/tests/test_interactive.py @@ -11,7 +11,7 @@ from spatialdata.models import Image2DModel from napari_spatialdata._interactive import Interactive -from tests.conftest import PlotTester, PlotTesterMeta, OFFSCREEN +from tests.conftest import OFFSCREEN, PlotTester, PlotTesterMeta ARM_PROBLEM = ( parse_version(version("numpy")) < parse_version("2") and sys.platform == "darwin" and platform.machine() == "arm64" diff --git a/tests/test_widgets.py b/tests/test_widgets.py index b569df52..ede04bb5 100644 --- a/tests/test_widgets.py +++ b/tests/test_widgets.py @@ -91,7 +91,7 @@ def test_change_layer( sdata_blobs: SpatialData, ) -> None: table = sdata_blobs["table"].copy() - table.obs["region"] = "blobs_labels" + table.obs["region"] = pd.Categorical(["blobs_labels"] * table.n_obs) table.uns["spatialdata_attrs"]["region"] = "blobs_labels" table.var_names = pd.Index([i + "_second" for i in table.var_names]) sdata_blobs["second_table"] = table