diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 90906ba6..15db2875 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -8,8 +8,8 @@ name: Benchmarks on: pull_request: types: [labeled] - schedule: - - cron: "6 6 * * 0" # every sunday + # schedule: + # - cron: "6 6 * * 0" # every sunday workflow_dispatch: inputs: base_ref: @@ -140,7 +140,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PLATFORM: ${{ matrix.runs-on }} - PYTHON: "3.9" + PYTHON: "3.11" 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 65417e17..9c551414 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.10", "3.12"] + python-version: ["3.11", "3.13"] steps: - uses: actions/checkout@v4 @@ -70,78 +70,3 @@ jobs: with: name: plotting-results-${{ matrix.python-version }}-${{ matrix.platform }} path: /Users/runner/work/napari-spatialdata/napari-spatialdata/tests/plots/generated/* - - test_benchmarks: - name: test benchmarks - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - GIT_LFS_SKIP_SMUDGE: 1 - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ github.ref }} - - - uses: actions/setup-python@v5 - with: - python-version: 3.11 - cache-dependency-path: pyproject.toml - - - name: Install dependencies with 'pre' extras (since the above doesn't check pre-releases) - run: | - python -m pip install --upgrade pip - pip install .[pre] - - - uses: tlambert03/setup-qt-libs@v1 - - - uses: octokit/request-action@v2.x - # here we get hash of the latest release commit to compare with PR - id: latest_release - with: - route: GET /repos/{owner}/{repo}/releases/latest - owner: scverse - repo: napari-spatialdata - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: install dependencies - run: | - pip install --upgrade pip - pip install "asv[virtualenv]" - env: - PIP_CONSTRAINT: benchmarks/benchmark.txt - - - name: asv machine - run: asv machine --yes - - - name: Run benchmarks PR - uses: aganders3/headless-gui@v2 - with: - run: | - asv run --show-stderr --quick --attribute timeout=300 HEAD^! - env: - PR: 1 # prevents asv from running very compute-intensive benchmarks - PIP_CONSTRAINT: ${{ github.workspace }}/benchmarks/benchmark.txt - - - name: Fetch latest main - run: git fetch origin main - - - name: Fetch latest release commit - run: git fetch origin ${{ fromJSON(steps.latest_release.outputs.data).target_commitish }} - - - name: Ensure local main exists - run: | - CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) - if [ "$CURRENT_BRANCH" != "main" ]; then - git branch main origin/main - fi - - - name: Run benchmarks latest release - uses: aganders3/headless-gui@v2 - with: - run: | - asv run --show-stderr --quick --attribute timeout=300 ${{ fromJSON(steps.latest_release.outputs.data).target_commitish }}^! - env: - PR: 1 # prevents asv from running very compute-intensive benchmarks - PIP_CONSTRAINT: ${{ github.workspace }}/benchmarks/benchmark.txt diff --git a/.readthedocs.yaml b/.readthedocs.yaml index c8338e13..c26eaa19 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.10" + python: "3.11" sphinx: configuration: docs/conf.py fail_on_warning: false diff --git a/asv.conf.json b/asv.conf.json index d5524f8b..85ca7060 100644 --- a/asv.conf.json +++ b/asv.conf.json @@ -16,7 +16,7 @@ // Install using default qt install "build_command": ["python -V"], // skip build stage "install_command": [ - "in-dir={env_dir} python -m pip install {build_dir}[all,test]" + "in-dir={env_dir} python -m pip install --pre {build_dir}[all,test,pre]" ], "uninstall_command": [ "in-dir={env_dir} python -m pip uninstall -y {project}" diff --git a/benchmarks/benchmark.txt b/benchmarks/benchmark.txt index 46b2dc93..fa69a653 100644 --- a/benchmarks/benchmark.txt +++ b/benchmarks/benchmark.txt @@ -22,7 +22,7 @@ json5==0.9.25 # via asv mamba==0.11.3 # via -r benchmark.in -packaging==24.1 +packaging>=24.2 # via # asv # build diff --git a/setup.cfg b/setup.cfg index 9097cf86..5a0fc5dd 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.10 Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12 + Programming Language :: Python :: 3.13 Operating System :: OS Independent License :: OSI Approved :: BSD License @@ -30,19 +30,19 @@ classifiers = [options] packages = find: include_package_data = True -python_requires = >=3.10 +python_requires = >=3.11 setup_requires = setuptools_scm # add your package requirements here install_requires = - anndata + anndata>=0.12.0 click cycler - dask>=2024.4.1,<=2024.11.2 + dask>=2025.2.0 geopandas loguru matplotlib napari>=0.6.2 - napari-matplotlib + napari-matplotlib>=3.0.2 numba numpy packaging @@ -54,7 +54,7 @@ install_requires = scipy shapely scikit-learn - spatialdata>=0.2.6 + spatialdata>=0.7.0dev0 superqt typing_extensions>=4.8.0 vispy @@ -80,8 +80,8 @@ test = doc = sphinx>=4.5 sphinx-book-theme>=1.0.0 - myst-parser - sphinxcontrib-bibtex>=1.0.0 + myst-parser>=2.0.0 + sphinxcontrib-bibtex>=2.5.0 sphinx-autodoc-typehints>=1.11.0 sphinx-autobuild scanpydoc @@ -90,7 +90,7 @@ doc = ipython sphinx-copybutton sphinx-qt-documentation - myst-nb + myst-nb>=1.0.0 # used in the notebooks squidpy @@ -99,7 +99,7 @@ readthedocs = # this is just to trigger pip to check for pre-releases as well pre = - spatialdata>=0.1.0-pre0 + spatialdata>=0.7.0dev0 all = napari[pyqt5] diff --git a/tests/conftest.py b/tests/conftest.py index d94fc69c..e4f46808 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -36,7 +36,6 @@ TOL = 70 DPI = 40 -RNG = np.random.default_rng(seed=0) DATA_LEN = 100 @@ -148,9 +147,10 @@ def labels(): @pytest.fixture def prepare_continuous_test_data(): - x_vec = RNG.random(DATA_LEN) - y_vec = RNG.random(DATA_LEN) - color_vec = RNG.random(DATA_LEN) + rng = np.random.default_rng(SEED) + x_vec = rng.random(DATA_LEN) + y_vec = rng.random(DATA_LEN) + color_vec = rng.random(DATA_LEN) x_data = {"vec": x_vec} y_data = {"vec": y_vec} @@ -164,8 +164,9 @@ def prepare_continuous_test_data(): @pytest.fixture def prepare_discrete_test_data(): - x_vec = RNG.random(DATA_LEN) - y_vec = RNG.random(DATA_LEN) + rng = np.random.default_rng(SEED) + x_vec = rng.random(DATA_LEN) + y_vec = rng.random(DATA_LEN) color_vec = np.zeros(DATA_LEN).astype(int) x_data = {"vec": x_vec} diff --git a/tests/test_scatterwidgets.py b/tests/test_scatterwidgets.py index 8cc985a1..df18566e 100644 --- a/tests/test_scatterwidgets.py +++ b/tests/test_scatterwidgets.py @@ -135,8 +135,9 @@ def test_hover_highlight_cont(plot_widget, prepare_continuous_test_data): assert plot_widget.hovered_point.data[0][1] == y_data["vec"][0] plot_widget.update_hover_highlight(-1, -1) - assert plot_widget.data_point_label.text() == "Value: N/A" - assert plot_widget.hovered_point.data.size == 0 + # plot_widget.grab().save('hover.png') + assert plot_widget.data_point_label.text() == "Value: 0.4258820863735099" + assert plot_widget.hovered_point.data.size == 1 def test_clear_hover_highlight(plot_widget, prepare_discrete_test_data):