napari-spatialdata 0.6.0__tar.gz → 0.7.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/.github/workflows/benchmarks.yml +8 -8
  2. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/.github/workflows/benchmarks_report.yml +3 -3
  3. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/.github/workflows/release.yml +2 -2
  4. napari_spatialdata-0.7.1/.github/workflows/test.yml +72 -0
  5. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/.gitignore +1 -0
  6. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/.pre-commit-config.yaml +6 -6
  7. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/.readthedocs.yaml +2 -2
  8. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/PKG-INFO +22 -22
  9. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/asv.conf.json +1 -1
  10. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/benchmarks/benchmark.txt +1 -1
  11. napari_spatialdata-0.7.1/docs/contributing.md +25 -0
  12. napari_spatialdata-0.7.1/docs/notebooks/mibitof_analysis.ipynb +250 -0
  13. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/notebooks/nanostring_analysis.ipynb +3 -43
  14. napari_spatialdata-0.7.1/docs/notebooks/spatialdata.ipynb +299 -0
  15. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/setup.cfg +11 -11
  16. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/_scatterwidgets.py +42 -3
  17. napari_spatialdata-0.7.1/src/napari_spatialdata/_version.py +24 -0
  18. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/_viewer.py +18 -13
  19. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/_widgets.py +10 -3
  20. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/constants/config.py +2 -0
  21. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/utils/_utils.py +7 -2
  22. napari_spatialdata-0.7.1/src/napari_spatialdata/utils/_viewer_utils.py +37 -0
  23. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata.egg-info/PKG-INFO +22 -22
  24. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata.egg-info/SOURCES.txt +1 -1
  25. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata.egg-info/requires.txt +9 -9
  26. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/tests/conftest.py +164 -7
  27. napari_spatialdata-0.7.1/tests/test_3d_visualization.py +161 -0
  28. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/tests/test_scatterwidgets.py +3 -2
  29. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/tests/test_spatialdata.py +2 -0
  30. napari_spatialdata-0.6.0/.github/workflows/test.yml +0 -147
  31. napari_spatialdata-0.6.0/docs/contributing.md +0 -3
  32. napari_spatialdata-0.6.0/docs/notebooks/mibitof_analysis.ipynb +0 -435
  33. napari_spatialdata-0.6.0/docs/notebooks/spatialdata.ipynb +0 -567
  34. napari_spatialdata-0.6.0/src/napari_spatialdata/_version.py +0 -34
  35. napari_spatialdata-0.6.0/src/napari_spatialdata/utils/_viewer_utils.py +0 -18
  36. napari_spatialdata-0.6.0/tests/test_aaa.py +0 -25
  37. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/.github/BENCHMARK_FAIL_TEMPLATE.md +0 -0
  38. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/.github/dependabot.yml +0 -0
  39. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/.github/release.yml +0 -0
  40. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/.mypy.ini +0 -0
  41. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/.napari/DESCRIPTION.md +0 -0
  42. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/LICENSE +0 -0
  43. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/MANIFEST.in +0 -0
  44. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/README.md +0 -0
  45. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/benchmarks/Readme.md +0 -0
  46. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/benchmarks/__init__.py +0 -0
  47. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/benchmarks/benchmark.in +0 -0
  48. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/benchmarks/benchmark_model.py +0 -0
  49. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/benchmarks/benchmark_qt_widget.py +0 -0
  50. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/Makefile +0 -0
  51. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/_static/.gitkeep +0 -0
  52. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/_templates/.gitkeep +0 -0
  53. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/_templates/autosummary/class.rst +0 -0
  54. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/api.md +0 -0
  55. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/changelog.md +0 -0
  56. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/cli.md +0 -0
  57. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/conf.py +0 -0
  58. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/extensions/typed_returns.py +0 -0
  59. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/index.md +0 -0
  60. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/limitations.md +0 -0
  61. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/make.bat +0 -0
  62. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/notebooks/scatterwidget.ipynb +0 -0
  63. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/notebooks/scatterwidget_annotation.ipynb +0 -0
  64. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/references.bib +0 -0
  65. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/docs/references.md +0 -0
  66. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/examples/spatialdata_empty.py +0 -0
  67. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/examples/spatialdata_visium.py +0 -0
  68. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/pyproject.toml +0 -0
  69. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/__init__.py +0 -0
  70. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/__main__.py +0 -0
  71. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/_annotationwidgets.py +0 -0
  72. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/_interactive.py +0 -0
  73. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/_model.py +0 -0
  74. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/_reader.py +0 -0
  75. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/_sdata_widgets.py +0 -0
  76. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/_view.py +0 -0
  77. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/constants/__init__.py +0 -0
  78. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/constants/_constants.py +0 -0
  79. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/constants/_pkg_constants.py +0 -0
  80. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/constants/_utils.py +0 -0
  81. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/napari.yaml +0 -0
  82. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/resources/exclamation.png +0 -0
  83. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/resources/icons8-home-48.png +0 -0
  84. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/resources/icons8-pencil-drawing-50.png +0 -0
  85. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/resources/icons8-polygon-80.png +0 -0
  86. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/resources/icons8-rectangle-48.png +0 -0
  87. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/utils/__init__.py +0 -0
  88. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/utils/_categoricals_utils.py +0 -0
  89. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata/utils/_test_utils.py +0 -0
  90. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata.egg-info/dependency_links.txt +0 -0
  91. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata.egg-info/entry_points.txt +0 -0
  92. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/src/napari_spatialdata.egg-info/top_level.txt +0 -0
  93. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/tests/__init__.py +0 -0
  94. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/tests/plots/groundtruth/Images_can_add_element_image.png +0 -0
  95. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/tests/plots/groundtruth/Images_can_add_element_label.png +0 -0
  96. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/tests/plots/groundtruth/Images_can_add_element_multiple.png +0 -0
  97. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/tests/test_cli.py +0 -0
  98. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/tests/test_interactive.py +0 -0
  99. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/tests/test_utils.py +0 -0
  100. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/tests/test_view.py +0 -0
  101. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/tests/test_viewer.py +0 -0
  102. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/tests/test_widgets.py +0 -0
  103. {napari_spatialdata-0.6.0 → napari_spatialdata-0.7.1}/tox.ini +0 -0
@@ -8,8 +8,8 @@ name: Benchmarks
8
8
  on:
9
9
  pull_request:
10
10
  types: [labeled]
11
- schedule:
12
- - cron: "6 6 * * 0" # every sunday
11
+ # schedule:
12
+ # - cron: "6 6 * * 0" # every sunday
13
13
  workflow_dispatch:
14
14
  inputs:
15
15
  base_ref:
@@ -59,11 +59,11 @@ jobs:
59
59
  steps:
60
60
  # We need the full repo to avoid this issue
61
61
  # https://github.com/actions/checkout/issues/23
62
- - uses: actions/checkout@v4
62
+ - uses: actions/checkout@v6
63
63
  with:
64
64
  fetch-depth: 0
65
65
 
66
- - uses: actions/setup-python@v5
66
+ - uses: actions/setup-python@v6
67
67
  name: Install Python
68
68
  with:
69
69
  python-version: "3.11"
@@ -140,7 +140,7 @@ jobs:
140
140
  env:
141
141
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142
142
  PLATFORM: ${{ matrix.runs-on }}
143
- PYTHON: "3.9"
143
+ PYTHON: "3.11"
144
144
  BACKEND: ${{ matrix.benchmark-name }}
145
145
  RUN_ID: ${{ github.run_id }}
146
146
  TITLE: "[test-bot] Benchmark tests failing"
@@ -170,7 +170,7 @@ jobs:
170
170
 
171
171
  fi
172
172
 
173
- - uses: actions/upload-artifact@v4
173
+ - uses: actions/upload-artifact@v7
174
174
  if: always()
175
175
  with:
176
176
  name: asv-benchmark-results-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-${{ matrix.benchmark-name }}
@@ -182,13 +182,13 @@ jobs:
182
182
  if: always()
183
183
  steps:
184
184
  - name: Download artifact
185
- uses: actions/download-artifact@v4
185
+ uses: actions/download-artifact@v8
186
186
  with:
187
187
  pattern: asv-benchmark-results*
188
188
  path: asv_result
189
189
  merge-multiple: true
190
190
  - name: Upload artifact
191
- uses: actions/upload-artifact@v4
191
+ uses: actions/upload-artifact@v7
192
192
  with:
193
193
  name: asv-benchmark-results-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
194
194
  path: asv_result
@@ -24,7 +24,7 @@ jobs:
24
24
  runs-on: ubuntu-latest
25
25
  steps:
26
26
  - name: "Download artifact"
27
- uses: actions/github-script@v7
27
+ uses: actions/github-script@v9
28
28
  with:
29
29
  script: |
30
30
  let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
@@ -68,7 +68,7 @@ jobs:
68
68
 
69
69
  - name: "Comment on PR"
70
70
  if: env.PR_NUMBER != ''
71
- uses: actions/github-script@v7
71
+ uses: actions/github-script@v9
72
72
  with:
73
73
  github-token: ${{ secrets.GITHUB_TOKEN }}
74
74
  script: |
@@ -84,7 +84,7 @@ jobs:
84
84
 
85
85
  - name: "Remove run-benchmarks label"
86
86
  if: env.PR_NUMBER != ''
87
- uses: actions/github-script@v7
87
+ uses: actions/github-script@v9
88
88
  with:
89
89
  github-token: ${{ secrets.GITHUB_TOKEN }}
90
90
  script: |
@@ -10,7 +10,7 @@ jobs:
10
10
  runs-on: ubuntu-latest
11
11
  if: startsWith(github.ref, 'refs/tags/v')
12
12
  steps:
13
- - uses: actions/checkout@v4
13
+ - uses: actions/checkout@v6
14
14
  - uses: hynek/build-and-inspect-python-package@v2
15
15
 
16
16
  upload-to-pypi:
@@ -21,7 +21,7 @@ jobs:
21
21
 
22
22
  steps:
23
23
  - name: Download built artifact to dist/
24
- uses: actions/download-artifact@v4
24
+ uses: actions/download-artifact@v8
25
25
  with:
26
26
  name: Packages
27
27
  path: dist
@@ -0,0 +1,72 @@
1
+ # This workflows will upload a Python Package using Twine when a release is created
2
+ # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3
+
4
+ name: tests
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - main
10
+ - npe2
11
+ tags:
12
+ - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
13
+ pull_request:
14
+ branches:
15
+ - main
16
+ - npe2
17
+ workflow_dispatch:
18
+
19
+ jobs:
20
+ test:
21
+ name: ${{ matrix.platform }} py${{ matrix.python-version }}
22
+ runs-on: ${{ matrix.platform }}
23
+ strategy:
24
+ fail-fast: false
25
+ matrix:
26
+ platform: [ubuntu-latest, macos-latest] # [ubuntu-latest, windows-latest, macos-latest]
27
+ python-version: ["3.11", "3.13"]
28
+
29
+ steps:
30
+ - uses: actions/checkout@v6
31
+
32
+ - name: Set up Python ${{ matrix.python-version }}
33
+ uses: actions/setup-python@v6
34
+ with:
35
+ python-version: ${{ matrix.python-version }}
36
+
37
+ # these libraries enable testing on Qt on linux
38
+ - uses: tlambert03/setup-qt-libs@v1
39
+
40
+ # strategy borrowed from vispy for installing opengl libs on windows
41
+ - name: Install Windows OpenGL
42
+ if: runner.os == 'Windows'
43
+ run: |
44
+ git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git
45
+ powershell gl-ci-helpers/appveyor/install_opengl.ps1
46
+
47
+ # note: if you need dependencies from conda, considering using
48
+ # setup-miniconda: https://github.com/conda-incubator/setup-miniconda
49
+ # and
50
+ # tox-conda: https://github.com/tox-dev/tox-conda
51
+ - name: Install dependencies
52
+ run: |
53
+ python -m pip install --upgrade pip
54
+ python -m pip install setuptools tox tox-gh-actions
55
+
56
+ # this runs the platform-specific tests declared in tox.ini
57
+ - name: Test with tox
58
+ uses: coactions/setup-xvfb@v1
59
+ with:
60
+ run: python -m tox
61
+ env:
62
+ PLATFORM: ${{ matrix.platform }}
63
+
64
+ - name: Coverage
65
+ uses: codecov/codecov-action@v6
66
+
67
+ - name: Archive figures generated during testing
68
+ if: always()
69
+ uses: actions/upload-artifact@v7
70
+ with:
71
+ name: plotting-results-${{ matrix.python-version }}-${{ matrix.platform }}
72
+ path: /Users/runner/work/napari-spatialdata/napari-spatialdata/tests/plots/generated/*
@@ -117,3 +117,4 @@ tests/plots/generated
117
117
 
118
118
  # Local temp script for testing user bugs (Luca)
119
119
  temp/
120
+ uv.lock
@@ -7,13 +7,13 @@ default_stages:
7
7
  minimum_pre_commit_version: 2.9.3
8
8
  repos:
9
9
  - repo: https://github.com/pre-commit/mirrors-mypy
10
- rev: v1.17.1
10
+ rev: v1.19.1
11
11
  hooks:
12
12
  - id: mypy
13
13
  additional_dependencies: [numpy>=1.23]
14
14
  exclude: docs
15
- - repo: https://github.com/psf/black
16
- rev: 25.1.0
15
+ - repo: https://github.com/psf/black-pre-commit-mirror
16
+ rev: 25.12.0
17
17
  hooks:
18
18
  - id: black
19
19
  additional_dependencies: [toml]
@@ -45,15 +45,15 @@ repos:
45
45
  - id: check-toml
46
46
  - id: requirements-txt-fixer
47
47
  - repo: https://github.com/asottile/blacken-docs
48
- rev: 1.19.1
48
+ rev: 1.20.0
49
49
  hooks:
50
50
  - id: blacken-docs
51
51
  - repo: https://github.com/astral-sh/ruff-pre-commit
52
- rev: v0.12.8
52
+ rev: v0.14.10
53
53
  hooks:
54
54
  - id: ruff
55
55
  args: [--fix, --exit-non-zero-on-fix]
56
56
  - repo: https://github.com/asottile/pyupgrade
57
- rev: v3.20.0
57
+ rev: v3.21.2
58
58
  hooks:
59
59
  - id: pyupgrade
@@ -3,7 +3,7 @@ version: 2
3
3
  build:
4
4
  os: ubuntu-22.04
5
5
  tools:
6
- python: "3.10"
6
+ python: "3.11"
7
7
  sphinx:
8
8
  configuration: docs/conf.py
9
9
  fail_on_warning: false
@@ -12,7 +12,7 @@ python:
12
12
  - method: pip
13
13
  path: .
14
14
  extra_requirements:
15
- - "doc"
15
+ - "docs"
16
16
  - "all"
17
17
  - "readthedocs"
18
18
  - "pre"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: napari-spatialdata
3
- Version: 0.6.0
3
+ Version: 0.7.1
4
4
  Summary: Interactive visualization of spatial omics data with napari
5
5
  Home-page: https://github.com/scverse/napari-spatialdata.git
6
6
  Author: giovanni palla
@@ -16,23 +16,23 @@ Classifier: Framework :: napari
16
16
  Classifier: Topic :: Software Development :: Testing
17
17
  Classifier: Programming Language :: Python
18
18
  Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.10
20
19
  Classifier: Programming Language :: Python :: 3.11
21
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
22
  Classifier: Operating System :: OS Independent
23
23
  Classifier: License :: OSI Approved :: BSD License
24
- Requires-Python: >=3.10
24
+ Requires-Python: >=3.11
25
25
  Description-Content-Type: text/markdown
26
26
  License-File: LICENSE
27
- Requires-Dist: anndata
27
+ Requires-Dist: anndata>=0.12.0
28
28
  Requires-Dist: click
29
29
  Requires-Dist: cycler
30
- Requires-Dist: dask<=2024.11.2,>=2024.4.1
30
+ Requires-Dist: dask>=2025.2.0
31
31
  Requires-Dist: geopandas
32
32
  Requires-Dist: loguru
33
33
  Requires-Dist: matplotlib
34
34
  Requires-Dist: napari>=0.6.2
35
- Requires-Dist: napari-matplotlib
35
+ Requires-Dist: napari-matplotlib>=3.0.2
36
36
  Requires-Dist: numba
37
37
  Requires-Dist: numpy
38
38
  Requires-Dist: packaging
@@ -44,7 +44,7 @@ Requires-Dist: scanpy
44
44
  Requires-Dist: scipy
45
45
  Requires-Dist: shapely
46
46
  Requires-Dist: scikit-learn
47
- Requires-Dist: spatialdata>=0.2.6
47
+ Requires-Dist: spatialdata>=0.7.2
48
48
  Requires-Dist: superqt
49
49
  Requires-Dist: typing_extensions>=4.8.0
50
50
  Requires-Dist: vispy
@@ -59,24 +59,24 @@ Requires-Dist: pytest-cov; extra == "test"
59
59
  Requires-Dist: pytest-mock; extra == "test"
60
60
  Requires-Dist: pytest-qt; extra == "test"
61
61
  Requires-Dist: pre-commit>=2.9.0; extra == "test"
62
- Provides-Extra: doc
63
- Requires-Dist: sphinx>=4.5; extra == "doc"
64
- Requires-Dist: sphinx-book-theme>=1.0.0; extra == "doc"
65
- Requires-Dist: myst-parser; extra == "doc"
66
- Requires-Dist: sphinxcontrib-bibtex>=1.0.0; extra == "doc"
67
- Requires-Dist: sphinx-autodoc-typehints>=1.11.0; extra == "doc"
68
- Requires-Dist: sphinx-autobuild; extra == "doc"
69
- Requires-Dist: scanpydoc; extra == "doc"
70
- Requires-Dist: ipykernel; extra == "doc"
71
- Requires-Dist: ipython; extra == "doc"
72
- Requires-Dist: sphinx-copybutton; extra == "doc"
73
- Requires-Dist: sphinx-qt-documentation; extra == "doc"
74
- Requires-Dist: myst-nb; extra == "doc"
75
- Requires-Dist: squidpy; extra == "doc"
62
+ Provides-Extra: docs
63
+ Requires-Dist: sphinx>=4.5; extra == "docs"
64
+ Requires-Dist: sphinx-book-theme>=1.0.0; extra == "docs"
65
+ Requires-Dist: myst-parser>=2.0.0; extra == "docs"
66
+ Requires-Dist: sphinxcontrib-bibtex>=2.5.0; extra == "docs"
67
+ Requires-Dist: sphinx-autodoc-typehints>=1.11.0; extra == "docs"
68
+ Requires-Dist: sphinx-autobuild; extra == "docs"
69
+ Requires-Dist: scanpydoc; extra == "docs"
70
+ Requires-Dist: ipykernel; extra == "docs"
71
+ Requires-Dist: ipython; extra == "docs"
72
+ Requires-Dist: sphinx-copybutton; extra == "docs"
73
+ Requires-Dist: sphinx-qt-documentation; extra == "docs"
74
+ Requires-Dist: myst-nb>=1.0.0; extra == "docs"
75
+ Requires-Dist: squidpy; extra == "docs"
76
76
  Provides-Extra: readthedocs
77
77
  Requires-Dist: pydantic>2; extra == "readthedocs"
78
78
  Provides-Extra: pre
79
- Requires-Dist: spatialdata>=0.1.0-pre0; extra == "pre"
79
+ Requires-Dist: spatialdata>=0.7.3a1; extra == "pre"
80
80
  Provides-Extra: all
81
81
  Requires-Dist: napari[pyqt5]; extra == "all"
82
82
  Dynamic: license-file
@@ -16,7 +16,7 @@
16
16
  // Install using default qt install
17
17
  "build_command": ["python -V"], // skip build stage
18
18
  "install_command": [
19
- "in-dir={env_dir} python -m pip install {build_dir}[all,test]"
19
+ "in-dir={env_dir} python -m pip install --pre {build_dir}[all,test,pre]"
20
20
  ],
21
21
  "uninstall_command": [
22
22
  "in-dir={env_dir} python -m pip uninstall -y {project}"
@@ -22,7 +22,7 @@ json5==0.9.25
22
22
  # via asv
23
23
  mamba==0.11.3
24
24
  # via -r benchmark.in
25
- packaging==24.1
25
+ packaging>=24.2
26
26
  # via
27
27
  # asv
28
28
  # build
@@ -0,0 +1,25 @@
1
+ # Contributing guide
2
+
3
+ Please refer to the [contribution guide from the `spatialdata` repository](https://github.com/scverse/spatialdata/blob/main/docs/contributing.md).
4
+
5
+ ## Debugging napari GUI tests
6
+
7
+ To visually inspect what a test is rendering in napari:
8
+
9
+ 1. Change `make_napari_viewer()` to `make_napari_viewer(show=True)`
10
+ 2. Add `napari.run()` before the end of the test (before the assertions)
11
+
12
+ Example:
13
+
14
+ ```python
15
+ import napari
16
+
17
+
18
+ def test_my_visualization(make_napari_viewer):
19
+ viewer = make_napari_viewer(show=True)
20
+ # ... setup code ...
21
+ napari.run()
22
+ # assertions...
23
+ ```
24
+
25
+ Remember to revert these changes before committing.
@@ -0,0 +1,250 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "attachments": {},
5
+ "cell_type": "markdown",
6
+ "metadata": {},
7
+ "source": "# Analyse MIBI-TOF in Napari-SpatialData\n"
8
+ },
9
+ {
10
+ "attachments": {},
11
+ "cell_type": "markdown",
12
+ "metadata": {},
13
+ "source": "This tutorial shows how to load and analyse the MIBI-TOF dataset with the Napari-SpatialData plugin.\n"
14
+ },
15
+ {
16
+ "attachments": {},
17
+ "cell_type": "markdown",
18
+ "metadata": {},
19
+ "source": [
20
+ "## Import packages and data"
21
+ ]
22
+ },
23
+ {
24
+ "attachments": {},
25
+ "cell_type": "markdown",
26
+ "metadata": {},
27
+ "source": [
28
+ "There are two options to install napari-spatialdata:\n",
29
+ "\n",
30
+ "(1) Install [napari](https://napari.org/stable/tutorials/fundamentals/installation.html) \n",
31
+ "\n",
32
+ "(2a) Run `pip install napari-spatialdata`\n",
33
+ "\n",
34
+ "or, \n",
35
+ "\n",
36
+ "(2b) Clone this [repo](https://github.com/scverse/napari-spatialdata) and run `pip install -e .`"
37
+ ]
38
+ },
39
+ {
40
+ "cell_type": "code",
41
+ "execution_count": 1,
42
+ "metadata": {},
43
+ "outputs": [],
44
+ "source": [
45
+ "%matplotlib inline\n",
46
+ "import matplotlib.pyplot as plt\n",
47
+ "from napari_spatialdata import Interactive\n",
48
+ "from spatialdata import SpatialData\n",
49
+ "import squidpy as sq\n",
50
+ "import scanpy as sc\n",
51
+ "\n",
52
+ "plt.rcParams['figure.figsize'] = (20, 20)"
53
+ ]
54
+ },
55
+ {
56
+ "attachments": {},
57
+ "cell_type": "markdown",
58
+ "metadata": {},
59
+ "source": [
60
+ "Please download the MIBI-TOF data from https://spatialdata.scverse.org/en/stable/tutorials/notebooks/datasets/README.html and adjust the variable containing the location of the .zarr file.\n",
61
+ "\n",
62
+ "Information regarding data licensing and attribution for the dataset listed above is available at: https://github.com/scverse/spatialdata-notebooks/tree/main/datasets."
63
+ ]
64
+ },
65
+ {
66
+ "attachments": {},
67
+ "cell_type": "markdown",
68
+ "metadata": {},
69
+ "source": [
70
+ "We will load the dataset from the filepath and create a {class}`spatialdata.SpatialData` object. We'll use this object with the class `Interactive` to visualise this dataset in Napari."
71
+ ]
72
+ },
73
+ {
74
+ "cell_type": "markdown",
75
+ "metadata": {},
76
+ "source": [
77
+ "FILE_PATH = \"tutorial_data/mibitof_data/data.zarr\" # Path to the data file. Change if your data is stored in a different location.\n",
78
+ "sdata = SpatialData.read(FILE_PATH)"
79
+ ]
80
+ },
81
+ {
82
+ "attachments": {},
83
+ "cell_type": "markdown",
84
+ "metadata": {},
85
+ "source": "To make it easier to analyse our data, we will filter the SpatialData object by the coordinate system \"point8\"."
86
+ },
87
+ {
88
+ "attachments": {},
89
+ "cell_type": "code",
90
+ "metadata": {},
91
+ "source": [
92
+ "sdata = sdata.filter_by_coordinate_system(\"point8\")\n",
93
+ "adata = sdata.table"
94
+ ],
95
+ "outputs": [],
96
+ "execution_count": null
97
+ },
98
+ {
99
+ "cell_type": "markdown",
100
+ "metadata": {},
101
+ "source": "The `scikit-misc package` could be required for highly variable genes identification."
102
+ },
103
+ {
104
+ "attachments": {},
105
+ "cell_type": "markdown",
106
+ "metadata": {},
107
+ "source": [
108
+ "Next, we will use the Scatter Widget offered by Napari SpatialData to visualize the UMAP coordinates.\n",
109
+ "\n",
110
+ "First, we instantiate the `Interactive` class with our {class}`spatialdata.SpatialData` object, and view it in Napari."
111
+ ]
112
+ },
113
+ {
114
+ "attachments": {},
115
+ "cell_type": "code",
116
+ "metadata": {},
117
+ "source": [
118
+ "interactive = Interactive(sdata)\n",
119
+ "interactive.run()"
120
+ ],
121
+ "outputs": [],
122
+ "execution_count": null
123
+ },
124
+ {
125
+ "cell_type": "code",
126
+ "execution_count": null,
127
+ "metadata": {},
128
+ "outputs": [],
129
+ "source": [
130
+ "plt.imshow(interactive.screenshot())\n",
131
+ "plt.axis('off')"
132
+ ]
133
+ },
134
+ {
135
+ "cell_type": "markdown",
136
+ "metadata": {},
137
+ "source": "We select the coordinate system \"point8\" and load the elements \"point8_image\" and \"point8_labels\" into the viewer."
138
+ },
139
+ {
140
+ "attachments": {},
141
+ "cell_type": "code",
142
+ "metadata": {},
143
+ "source": [
144
+ "plt.imshow(interactive.screenshot())\n",
145
+ "plt.axis('off')"
146
+ ],
147
+ "outputs": [],
148
+ "execution_count": null
149
+ },
150
+ {
151
+ "cell_type": "markdown",
152
+ "metadata": {},
153
+ "source": "Select \"point8_labels\" in the list of layers. Then, we open the \"Scatter\" Widget by using the menu bar and going to Plugins > napari-spatialdata > Scatter. This loads the AnnData object associated with that layer into the \"Scatter\" Widget."
154
+ },
155
+ {
156
+ "attachments": {},
157
+ "cell_type": "code",
158
+ "metadata": {},
159
+ "source": [
160
+ "plt.imshow(interactive.screenshot())\n",
161
+ "plt.axis('off')"
162
+ ],
163
+ "outputs": [],
164
+ "execution_count": null
165
+ },
166
+ {
167
+ "cell_type": "markdown",
168
+ "metadata": {},
169
+ "source": [
170
+ "Then, we can now pick specific x-axis, y-axis and color values to visualize in the scatterplot.\n",
171
+ "\n",
172
+ "In the example below, we're visualizing the UMAP (Uniform Manifold Approximation and Projection) coordinates of two different axes and coloring it by cell size."
173
+ ]
174
+ },
175
+ {
176
+ "attachments": {},
177
+ "cell_type": "code",
178
+ "metadata": {},
179
+ "source": [
180
+ "plt.imshow(interactive.screenshot())\n",
181
+ "plt.axis('off')"
182
+ ],
183
+ "outputs": [],
184
+ "execution_count": null
185
+ },
186
+ {
187
+ "cell_type": "markdown",
188
+ "metadata": {},
189
+ "source": [
190
+ "After plotting, it is possible to interactively select clusters and export it to AnnData.\n",
191
+ "\n",
192
+ "In the example below, we used the cursor to select a cluster on the left half of the scatterplot. We can export it into AnnData by clicking on the \"Annotate\" button."
193
+ ]
194
+ },
195
+ {
196
+ "attachments": {},
197
+ "cell_type": "code",
198
+ "metadata": {},
199
+ "source": [
200
+ "plt.imshow(interactive.screenshot())\n",
201
+ "plt.axis('off')"
202
+ ],
203
+ "outputs": [],
204
+ "execution_count": null
205
+ },
206
+ {
207
+ "cell_type": "markdown",
208
+ "metadata": {},
209
+ "source": "After exporting, we can now view the selected points with the View widget. Close the Scatter Widget and from the menu bar, go to Plugins > napari-spatialdata > View. You should be able to observe \"my_annotation\" under \"Observations:\". This is selected points we exported in the previous step."
210
+ },
211
+ {
212
+ "attachments": {},
213
+ "cell_type": "markdown",
214
+ "metadata": {},
215
+ "source": "Double clicking on \"my_annotation\" loads it as a layer in the Napari viewer."
216
+ },
217
+ {
218
+ "attachments": {},
219
+ "cell_type": "code",
220
+ "metadata": {},
221
+ "source": [
222
+ "plt.imshow(interactive.screenshot())\n",
223
+ "plt.axis('off')"
224
+ ],
225
+ "outputs": [],
226
+ "execution_count": null
227
+ }
228
+ ],
229
+ "metadata": {
230
+ "kernelspec": {
231
+ "display_name": "Python 3 (ipykernel)",
232
+ "language": "python",
233
+ "name": "python3"
234
+ },
235
+ "language_info": {
236
+ "codemirror_mode": {
237
+ "name": "ipython",
238
+ "version": 3
239
+ },
240
+ "file_extension": ".py",
241
+ "mimetype": "text/x-python",
242
+ "name": "python",
243
+ "nbconvert_exporter": "python",
244
+ "pygments_lexer": "ipython3",
245
+ "version": "3.10.14"
246
+ }
247
+ },
248
+ "nbformat": 4,
249
+ "nbformat_minor": 4
250
+ }
@@ -4,17 +4,13 @@
4
4
  "attachments": {},
5
5
  "cell_type": "markdown",
6
6
  "metadata": {},
7
- "source": [
8
- "# Analyse Nanostring data in Napari-SpatialData \n"
9
- ]
7
+ "source": "# Analyse Cosmx data in Napari-SpatialData\n"
10
8
  },
11
9
  {
12
10
  "attachments": {},
13
11
  "cell_type": "markdown",
14
12
  "metadata": {},
15
- "source": [
16
- "This tutorial shows how to load and analyse Nanostring data with the Napari-SpatialData plugin.\n"
17
- ]
13
+ "source": "This tutorial shows how to load and analyze Cosmx data with the Napari-SpatialData plugin.\n"
18
14
  },
19
15
  {
20
16
  "attachments": {},
@@ -60,43 +56,7 @@
60
56
  "attachments": {},
61
57
  "cell_type": "markdown",
62
58
  "metadata": {},
63
- "source": [
64
- "Next, we will download the Nanostring dataset (cosmx_io) for analysis. \n",
65
- "\n",
66
- "If on Windows, download the dataset from https://s3.embl.de/spatialdata/spatialdata-sandbox/cosmx_io.zip.\n",
67
- "\n",
68
- "In on Linux, uncomment the lines below to download the dataset. "
69
- ]
70
- },
71
- {
72
- "cell_type": "code",
73
- "execution_count": 2,
74
- "metadata": {},
75
- "outputs": [
76
- {
77
- "name": "stdout",
78
- "output_type": "stream",
79
- "text": [
80
- "--2023-05-03 21:11:58-- https://s3.embl.de/spatialdata/spatialdata-sandbox/cosmx_io.zip\n",
81
- "Resolving s3.embl.de (s3.embl.de)... 194.94.45.80\n",
82
- "Connecting to s3.embl.de (s3.embl.de)|194.94.45.80|:443... connected.\n",
83
- "HTTP request sent, awaiting response... 200 OK\n",
84
- "Length: 2210531049 (2,1G) [application/zip]\n",
85
- "Saving to: ‘tutorial_data/nanostring_data/cosmx_io.zip’\n",
86
- "\n",
87
- "cosmx_io.zip 100%[===================>] 2,06G 10,9MB/s in 3m 21s \n",
88
- "\n",
89
- "2023-05-03 21:15:19 (10,5 MB/s) - ‘tutorial_data/nanostring_data/cosmx_io.zip’ saved [2210531049/2210531049]\n",
90
- "\n"
91
- ]
92
- }
93
- ],
94
- "source": [
95
- "# !mkdir tutorial_data\n",
96
- "# !mkdir tutorial_data/nanostring_data\n",
97
- "# !wget -P tutorial_data/nanostring_data https://s3.embl.de/spatialdata/spatialdata-sandbox/cosmx_io.zip\n",
98
- "# !unzip tutorial_data/nanostring_data/cosmx_io.zip -d tutorial_data/nanostring_data"
99
- ]
59
+ "source": "Please download the CosMx raw data from https://brukerspatialbiology.com/products/cosmx-spatial-molecular-imager/ffpe-dataset/nsclc-ffpe-dataset/, parse it using `spatialdata_io` and save it to the SpatialData Zarr format (you can for instance [use this script](https://github.com/giovp/spatialdata-sandbox/blob/main/cosmx_io/to_zarr.py)).\n"
100
60
  },
101
61
  {
102
62
  "attachments": {},