From ac2a4cadc25bc39b7b2ee6d5f2055f94511a051a Mon Sep 17 00:00:00 2001 From: Luca Marconato Date: Tue, 8 Sep 2026 14:18:09 +0200 Subject: [PATCH 1/2] fix AttributeError: 'AnnData' object has no attribute '_get_X' --- src/napari_spatialdata/_model.py | 3 ++- tests/conftest.py | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/napari_spatialdata/_model.py b/src/napari_spatialdata/_model.py index dd30b786..06bceeb3 100644 --- a/src/napari_spatialdata/_model.py +++ b/src/napari_spatialdata/_model.py @@ -136,7 +136,8 @@ def get_var( except KeyError: raise KeyError(f"Key `{name}` not found in `adata.var_names`.") from None - column = self.adata._get_X(layer=self.adata_layer)[ix] + X = self.adata.X if self.adata_layer is None else self.adata.layers[self.adata_layer] + column = X[ix] index = self.adata.obs[[self.instance_key]].set_index(self.instance_key).index return column, self._format_key(name, adata_layer=True), index diff --git a/tests/conftest.py b/tests/conftest.py index 553f1cea..1f9c2d89 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -219,7 +219,6 @@ def adata_shapes() -> AnnData: obsm_shapes = {"spatial": rng.integers(0, blobs.shape[0], size=(n_obs_shapes, 2))} return AnnData( rng.normal(size=(n_obs_shapes, n_var)), - dtype=np.float64, obs=obs_shapes, obsm=obsm_shapes, uns=uns_shapes, @@ -295,7 +294,6 @@ def generate_adata(n_var: int, obs: pd.DataFrame, obsm: dict[Any, Any], uns: dic obs=obs, obsm=obsm, uns=uns, - dtype=np.float64, ) From 223f32a77de57d3bb4673d28eaa65eff09099d7f Mon Sep 17 00:00:00 2001 From: Luca Marconato Date: Tue, 8 Sep 2026 14:28:07 +0200 Subject: [PATCH 2/2] bump min python dep to 3.12; test up to 3.14 --- .github/workflows/benchmarks.yml | 4 ++-- .github/workflows/test.yml | 2 +- .readthedocs.yaml | 2 +- asv.conf.json | 2 +- setup.cfg | 4 ++-- tox.ini | 5 +++-- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index cac37010..7aeede1a 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -66,7 +66,7 @@ jobs: - uses: actions/setup-python@v6 name: Install Python with: - python-version: "3.11" + python-version: "3.12" cache-dependency-path: pyproject.toml - uses: tlambert03/setup-qt-libs@v1 @@ -140,7 +140,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PLATFORM: ${{ matrix.runs-on }} - PYTHON: "3.11" + PYTHON: "3.12" BACKEND: ${{ matrix.benchmark-name }} RUN_ID: ${{ github.run_id }} TITLE: "[test-bot] Benchmark tests failing" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a5b32b92..931046d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: fail-fast: false matrix: platform: [ubuntu-latest, macos-latest] # [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.11", "3.13"] + python-version: ["3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v6 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 0001ece1..a6830d4c 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.11" + python: "3.12" sphinx: configuration: docs/conf.py fail_on_warning: false diff --git a/asv.conf.json b/asv.conf.json index 85ca7060..746d297b 100644 --- a/asv.conf.json +++ b/asv.conf.json @@ -35,7 +35,7 @@ "show_commit_url": "http://github.com/napari/napari/commit/", // The Pythons you'd like to test against. - "pythons": ["3.11"], + "pythons": ["3.12"], // The directory (relative to the current directory) to cache the Python // environments in. diff --git a/setup.cfg b/setup.cfg index 0dedfa0e..5ff2f17e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,9 +20,9 @@ classifiers = Topic :: Software Development :: Testing Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12 Programming Language :: Python :: 3.13 + Programming Language :: Python :: 3.14 Operating System :: OS Independent License :: OSI Approved :: BSD License @@ -30,7 +30,7 @@ classifiers = [options] packages = find: include_package_data = True -python_requires = >=3.11 +python_requires = >=3.12 setup_requires = setuptools_scm # add your package requirements here install_requires = diff --git a/tox.ini b/tox.ini index 358f0592..b62b2031 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,12 @@ [tox] -envlist = py{310,312}-{linux,macos,windows} +envlist = py{312,313,314}-{linux,macos,windows} isolated_build=true [gh-actions] python = - 3.10: py310 3.12: py312 + 3.13: py313 + 3.14: py314 [gh-actions:env] PLATFORM =