napari-spatialdata 0.4.0__tar.gz → 0.4.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.
- napari-spatialdata-0.4.1/.github/workflows/release.yml +30 -0
- napari-spatialdata-0.4.0/.github/workflows/test_and_deploy.yml → napari-spatialdata-0.4.1/.github/workflows/test.yml +0 -26
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/.pre-commit-config.yaml +1 -1
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/PKG-INFO +1 -1
- napari-spatialdata-0.4.1/src/napari_spatialdata/_constants/config.py +4 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_sdata_widgets.py +36 -1
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_version.py +2 -2
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_view.py +8 -10
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_viewer.py +12 -9
- napari-spatialdata-0.4.1/src/napari_spatialdata/resources/exclamation.png +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/utils/_utils.py +4 -2
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata.egg-info/PKG-INFO +1 -1
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata.egg-info/SOURCES.txt +3 -1
- napari-spatialdata-0.4.0/src/napari_spatialdata/_constants/config.py +0 -2
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/.gitignore +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/.mypy.ini +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/.napari/DESCRIPTION.md +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/.readthedocs.yaml +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/CHANGELOG.md +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/LICENSE +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/MANIFEST.in +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/README.md +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/Makefile +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/_static/.gitkeep +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/_templates/.gitkeep +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/_templates/autosummary/class.rst +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/api.md +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/cli.md +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/conf.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/contributing.md +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/extensions/typed_returns.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/index.md +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/make.bat +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/notebooks/mibitof_analysis.ipynb +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/notebooks/nanostring_analysis.ipynb +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/notebooks/scatterwidget.ipynb +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/notebooks/spatialdata.ipynb +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/references.bib +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/references.md +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/template_usage.md +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/examples/spatialdata_empty.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/examples/spatialdata_visium.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/pyproject.toml +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/setup.cfg +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/__init__.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/__main__.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_constants/__init__.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_constants/_constants.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_constants/_pkg_constants.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_constants/_utils.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_interactive.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_model.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_reader.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_scatterwidgets.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_widgets.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/napari.yaml +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/utils/__init__.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/utils/_categoricals_utils.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/utils/_test_utils.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/utils/_viewer_utils.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata.egg-info/dependency_links.txt +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata.egg-info/entry_points.txt +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata.egg-info/requires.txt +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata.egg-info/top_level.txt +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/tests/__init__.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/tests/conftest.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/tests/plots/groundtruth/Images_can_add_element_image.png +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/tests/plots/groundtruth/Images_can_add_element_label.png +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/tests/plots/groundtruth/Images_can_add_element_multiple.png +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/tests/test_cli.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/tests/test_interactive.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/tests/test_scatterwidgets.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/tests/test_spatialdata.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/tests/test_utils.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/tests/test_viewer.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/tests/test_widgets.py +0 -0
- {napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/tox.ini +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
release:
|
|
9
|
+
# requires that you have put your twine API key in your
|
|
10
|
+
# github secrets (see readme for details)
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
if: contains(github.ref, 'tags')
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v2
|
|
15
|
+
- name: Set up Python
|
|
16
|
+
uses: actions/setup-python@v2
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.x"
|
|
19
|
+
- name: Install dependencies
|
|
20
|
+
run: |
|
|
21
|
+
python -m pip install --upgrade pip
|
|
22
|
+
pip install -U setuptools setuptools_scm wheel twine build
|
|
23
|
+
- name: Build and publish
|
|
24
|
+
env:
|
|
25
|
+
TWINE_USERNAME: __token__
|
|
26
|
+
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
|
|
27
|
+
run: |
|
|
28
|
+
git tag
|
|
29
|
+
python -m build .
|
|
30
|
+
twine upload dist/*
|
|
@@ -62,29 +62,3 @@ jobs:
|
|
|
62
62
|
|
|
63
63
|
- name: Coverage
|
|
64
64
|
uses: codecov/codecov-action@v3
|
|
65
|
-
|
|
66
|
-
deploy:
|
|
67
|
-
# this will run when you have tagged a commit, starting with "v*"
|
|
68
|
-
# and requires that you have put your twine API key in your
|
|
69
|
-
# github secrets (see readme for details)
|
|
70
|
-
needs: [test]
|
|
71
|
-
runs-on: ubuntu-latest
|
|
72
|
-
if: contains(github.ref, 'tags')
|
|
73
|
-
steps:
|
|
74
|
-
- uses: actions/checkout@v2
|
|
75
|
-
- name: Set up Python
|
|
76
|
-
uses: actions/setup-python@v2
|
|
77
|
-
with:
|
|
78
|
-
python-version: "3.x"
|
|
79
|
-
- name: Install dependencies
|
|
80
|
-
run: |
|
|
81
|
-
python -m pip install --upgrade pip
|
|
82
|
-
pip install -U setuptools setuptools_scm wheel twine build
|
|
83
|
-
- name: Build and publish
|
|
84
|
-
env:
|
|
85
|
-
TWINE_USERNAME: __token__
|
|
86
|
-
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
|
|
87
|
-
run: |
|
|
88
|
-
git tag
|
|
89
|
-
python -m build .
|
|
90
|
-
twine upload dist/*
|
{napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_sdata_widgets.py
RENAMED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from pathlib import Path
|
|
3
4
|
from typing import TYPE_CHECKING, Iterable
|
|
4
5
|
|
|
5
6
|
import shapely
|
|
6
7
|
from napari.utils.events import EventedList
|
|
8
|
+
from qtpy.QtGui import QIcon
|
|
7
9
|
from qtpy.QtWidgets import QLabel, QListWidget, QListWidgetItem, QVBoxLayout, QWidget
|
|
8
10
|
from spatialdata import SpatialData
|
|
9
11
|
|
|
12
|
+
from napari_spatialdata._constants.config import N_CIRCLES_WARNING_THRESHOLD, N_SHAPES_WARNING_THRESHOLD
|
|
10
13
|
from napari_spatialdata._viewer import SpatialDataViewer
|
|
11
14
|
from napari_spatialdata.utils._utils import _get_sdata_key, get_duplicate_element_names, get_elements_meta_mapping
|
|
12
15
|
|
|
@@ -14,10 +17,13 @@ if TYPE_CHECKING:
|
|
|
14
17
|
from napari import Viewer
|
|
15
18
|
from napari.utils.events.event import Event
|
|
16
19
|
|
|
20
|
+
icon_path = Path(__file__).parent / "resources/exclamation.png"
|
|
21
|
+
|
|
17
22
|
|
|
18
23
|
class ElementWidget(QListWidget):
|
|
19
24
|
def __init__(self, sdata: EventedList):
|
|
20
25
|
super().__init__()
|
|
26
|
+
self._icon = QIcon(str(icon_path))
|
|
21
27
|
self._sdata = sdata
|
|
22
28
|
self._duplicate_element_names, _ = get_duplicate_element_names(self._sdata)
|
|
23
29
|
self._elements: None | dict[str, dict[str, str | int]] = None
|
|
@@ -25,9 +31,38 @@ class ElementWidget(QListWidget):
|
|
|
25
31
|
def _onItemChange(self, selected_coordinate_system: QListWidgetItem | int | Iterable[str]) -> None:
|
|
26
32
|
self.clear()
|
|
27
33
|
elements, _ = get_elements_meta_mapping(self._sdata, selected_coordinate_system, self._duplicate_element_names)
|
|
28
|
-
self.
|
|
34
|
+
self._set_element_widget_items(elements)
|
|
29
35
|
self._elements = elements
|
|
30
36
|
|
|
37
|
+
def _set_element_widget_items(self, elements: dict[str, dict[str, str | int]]) -> None:
|
|
38
|
+
for key, dict_val in elements.items():
|
|
39
|
+
sdata = self._sdata[dict_val["sdata_index"]]
|
|
40
|
+
element_type = dict_val["element_type"]
|
|
41
|
+
element_name = dict_val["original_name"]
|
|
42
|
+
item = QListWidgetItem(key)
|
|
43
|
+
if element_type == "shapes":
|
|
44
|
+
if (
|
|
45
|
+
type((element := sdata.shapes[element_name]).iloc[0].geometry) == shapely.Point
|
|
46
|
+
and len(element) > N_CIRCLES_WARNING_THRESHOLD
|
|
47
|
+
):
|
|
48
|
+
item.setIcon(self._icon)
|
|
49
|
+
item.setToolTip(
|
|
50
|
+
"Visualizing this many circles is currently slow in napari. Consider whether you want to "
|
|
51
|
+
"visualize."
|
|
52
|
+
)
|
|
53
|
+
self.addItem(item)
|
|
54
|
+
elif (
|
|
55
|
+
type((element := sdata.shapes[element_name]).iloc[0].geometry)
|
|
56
|
+
in [shapely.Polygon, shapely.MultiPolygon]
|
|
57
|
+
and len(element) > N_SHAPES_WARNING_THRESHOLD
|
|
58
|
+
):
|
|
59
|
+
item.setIcon(self._icon)
|
|
60
|
+
item.setToolTip(
|
|
61
|
+
"Visualizing this many shapes is currently slow in napari. Consider whether you want to "
|
|
62
|
+
"visualize."
|
|
63
|
+
)
|
|
64
|
+
self.addItem(item)
|
|
65
|
+
|
|
31
66
|
|
|
32
67
|
class CoordinateSystemWidget(QListWidget):
|
|
33
68
|
def __init__(self, sdata: EventedList):
|
|
@@ -2,8 +2,6 @@ from typing import Any, FrozenSet, Optional, Sequence
|
|
|
2
2
|
|
|
3
3
|
import napari
|
|
4
4
|
from anndata import AnnData
|
|
5
|
-
from dask.dataframe.core import DataFrame as DaskDataFrame
|
|
6
|
-
from geopandas.geodataframe import GeoDataFrame
|
|
7
5
|
from loguru import logger
|
|
8
6
|
from napari._qt.qt_resources import get_stylesheet
|
|
9
7
|
from napari._qt.utils import QImg2array
|
|
@@ -18,7 +16,7 @@ from qtpy.QtWidgets import (
|
|
|
18
16
|
QVBoxLayout,
|
|
19
17
|
QWidget,
|
|
20
18
|
)
|
|
21
|
-
from spatialdata import
|
|
19
|
+
from spatialdata import join_spatialelement_table
|
|
22
20
|
|
|
23
21
|
from napari_spatialdata._model import DataModel
|
|
24
22
|
from napari_spatialdata._scatterwidgets import AxisWidgets, MatplotlibWidget
|
|
@@ -119,7 +117,9 @@ class QtAdataScatterWidget(QWidget):
|
|
|
119
117
|
|
|
120
118
|
if sdata := layer.metadata.get("sdata"):
|
|
121
119
|
element_name = layer.metadata.get("name")
|
|
122
|
-
_, table =
|
|
120
|
+
_, table = join_spatialelement_table(
|
|
121
|
+
sdata=sdata, spatial_element_names=element_name, table_name=table_name, how="left"
|
|
122
|
+
)
|
|
123
123
|
layer.metadata["adata"] = table
|
|
124
124
|
|
|
125
125
|
if layer is not None and "adata" in layer.metadata:
|
|
@@ -315,11 +315,7 @@ class QtAdataViewWidget(QWidget):
|
|
|
315
315
|
self.var_widget.clear()
|
|
316
316
|
self.obsm_widget.clear()
|
|
317
317
|
self.color_by.clear()
|
|
318
|
-
if (
|
|
319
|
-
isinstance(layer, (Points, Shapes))
|
|
320
|
-
and isinstance(layer.metadata["sdata"][layer.metadata["name"]], (DaskDataFrame, GeoDataFrame))
|
|
321
|
-
and (cols_df := layer.metadata["_columns_df"]) is not None
|
|
322
|
-
):
|
|
318
|
+
if isinstance(layer, (Points, Shapes)) and (cols_df := layer.metadata.get("_columns_df")) is not None:
|
|
323
319
|
self.dataframe_columns_widget.addItems(map(str, cols_df.columns))
|
|
324
320
|
self.model.system_name = layer.metadata.get("name", None)
|
|
325
321
|
return
|
|
@@ -351,7 +347,9 @@ class QtAdataViewWidget(QWidget):
|
|
|
351
347
|
if sdata := layer.metadata.get("sdata"):
|
|
352
348
|
element_name = layer.metadata.get("name")
|
|
353
349
|
how = "left" if isinstance(layer, Labels) else "inner"
|
|
354
|
-
_, table =
|
|
350
|
+
_, table = join_spatialelement_table(
|
|
351
|
+
sdata=sdata, spatial_element_names=element_name, table_name=table_name, how=how
|
|
352
|
+
)
|
|
355
353
|
layer.metadata["adata"] = table
|
|
356
354
|
|
|
357
355
|
if layer is not None and "adata" in layer.metadata:
|
|
@@ -18,7 +18,7 @@ from spatialdata._core.query.relational_query import (
|
|
|
18
18
|
_get_unique_label_values_as_index,
|
|
19
19
|
_left_join_spatialelement_table,
|
|
20
20
|
)
|
|
21
|
-
from spatialdata.models import PointsModel, ShapesModel
|
|
21
|
+
from spatialdata.models import PointsModel, ShapesModel, force_2d
|
|
22
22
|
from spatialdata.transformations import Affine, Identity
|
|
23
23
|
from spatialdata.transformations._utils import scale_radii
|
|
24
24
|
|
|
@@ -35,7 +35,6 @@ from napari_spatialdata.utils._viewer_utils import _get_polygons_properties
|
|
|
35
35
|
|
|
36
36
|
if TYPE_CHECKING:
|
|
37
37
|
import numpy.typing as npt
|
|
38
|
-
from dask.dataframe.core import DataFrame as DaskDataFrame
|
|
39
38
|
from napari.layers import Layer
|
|
40
39
|
from napari.utils.events import Event, EventedList
|
|
41
40
|
from spatialdata import SpatialData
|
|
@@ -49,8 +48,8 @@ class SpatialDataViewer(QObject):
|
|
|
49
48
|
self.viewer = viewer
|
|
50
49
|
self.sdata = sdata
|
|
51
50
|
self._layer_event_caches: dict[str, list[dict[str, Any]]] = {}
|
|
52
|
-
self.viewer.bind_key("Shift-L", self._inherit_metadata, overwrite=
|
|
53
|
-
self.viewer.bind_key("Shift-E", self._save_to_sdata, overwrite=
|
|
51
|
+
self.viewer.bind_key("Shift-L", self._inherit_metadata, overwrite=True)
|
|
52
|
+
self.viewer.bind_key("Shift-E", self._save_to_sdata, overwrite=True)
|
|
54
53
|
self.viewer.layers.events.inserted.connect(self._on_layer_insert)
|
|
55
54
|
self._active_layer_table_names = None
|
|
56
55
|
self.viewer.layers.events.removed.connect(self._on_layer_removed)
|
|
@@ -182,8 +181,11 @@ class SpatialDataViewer(QObject):
|
|
|
182
181
|
raise ValueError("Cannot export a points element with no points")
|
|
183
182
|
transformed_data = np.array([selected.data_to_world(xy) for xy in selected.data])
|
|
184
183
|
swap_data = np.fliplr(transformed_data)
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
# ignore z axis if present
|
|
185
|
+
if swap_data.shape[1] == 3:
|
|
186
|
+
swap_data = swap_data[:, :2]
|
|
187
|
+
parsed = PointsModel.parse(swap_data, transformations=transformation)
|
|
188
|
+
sdata.points[selected.name] = parsed
|
|
187
189
|
if type(selected) == Shapes:
|
|
188
190
|
if len(selected.data) == 0:
|
|
189
191
|
raise ValueError("Cannot export a shapes element with no shapes")
|
|
@@ -191,15 +193,16 @@ class SpatialDataViewer(QObject):
|
|
|
191
193
|
Polygon(i) for i in _transform_coordinates(selected.data, f=lambda x: x[::-1])
|
|
192
194
|
]
|
|
193
195
|
gdf = GeoDataFrame({"geometry": polygons})
|
|
194
|
-
|
|
195
|
-
|
|
196
|
+
force_2d(gdf)
|
|
197
|
+
parsed = ShapesModel.parse(gdf, transformations=transformation)
|
|
198
|
+
sdata.shapes[selected.name] = parsed
|
|
196
199
|
swap_data = None
|
|
197
200
|
if type(selected) == Image or type(selected) == Labels:
|
|
198
201
|
raise NotImplementedError
|
|
199
202
|
|
|
200
203
|
self.layer_names.add(selected.name)
|
|
201
204
|
self._layer_event_caches[selected.name] = []
|
|
202
|
-
self._update_metadata(selected,
|
|
205
|
+
self._update_metadata(selected, parsed, swap_data)
|
|
203
206
|
selected.events.data.connect(self._update_cache_indices)
|
|
204
207
|
selected.events.name.connect(self._validate_name)
|
|
205
208
|
self.layer_saved.emit(coordinate_system)
|
{napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/utils/_utils.py
RENAMED
|
@@ -27,7 +27,7 @@ from pandas.core.dtypes.common import (
|
|
|
27
27
|
from scipy.sparse import issparse, spmatrix
|
|
28
28
|
from scipy.spatial import KDTree
|
|
29
29
|
from spatial_image import SpatialImage
|
|
30
|
-
from spatialdata import SpatialData, get_extent,
|
|
30
|
+
from spatialdata import SpatialData, get_extent, join_spatialelement_table
|
|
31
31
|
from spatialdata.models import SpatialElement, get_axes_names
|
|
32
32
|
from spatialdata.transformations import get_transformation
|
|
33
33
|
|
|
@@ -383,7 +383,9 @@ def _get_init_metadata_adata(sdata: SpatialData, table_name: str, element_name:
|
|
|
383
383
|
"""
|
|
384
384
|
if not table_name:
|
|
385
385
|
return None
|
|
386
|
-
_, adata =
|
|
386
|
+
_, adata = join_spatialelement_table(
|
|
387
|
+
sdata=sdata, spatial_element_names=element_name, table_name=table_name, how="left", match_rows="left"
|
|
388
|
+
)
|
|
387
389
|
|
|
388
390
|
if adata.shape[0] == 0:
|
|
389
391
|
return None
|
{napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata.egg-info/SOURCES.txt
RENAMED
|
@@ -9,7 +9,8 @@ README.md
|
|
|
9
9
|
pyproject.toml
|
|
10
10
|
setup.cfg
|
|
11
11
|
tox.ini
|
|
12
|
-
.github/workflows/
|
|
12
|
+
.github/workflows/release.yml
|
|
13
|
+
.github/workflows/test.yml
|
|
13
14
|
.napari/DESCRIPTION.md
|
|
14
15
|
docs/Makefile
|
|
15
16
|
docs/api.md
|
|
@@ -54,6 +55,7 @@ src/napari_spatialdata/_constants/_constants.py
|
|
|
54
55
|
src/napari_spatialdata/_constants/_pkg_constants.py
|
|
55
56
|
src/napari_spatialdata/_constants/_utils.py
|
|
56
57
|
src/napari_spatialdata/_constants/config.py
|
|
58
|
+
src/napari_spatialdata/resources/exclamation.png
|
|
57
59
|
src/napari_spatialdata/utils/__init__.py
|
|
58
60
|
src/napari_spatialdata/utils/_categoricals_utils.py
|
|
59
61
|
src/napari_spatialdata/utils/_test_utils.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/docs/notebooks/nanostring_analysis.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_constants/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_constants/_utils.py
RENAMED
|
File without changes
|
{napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_interactive.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/_scatterwidgets.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/utils/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/utils/_test_utils.py
RENAMED
|
File without changes
|
{napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata/utils/_viewer_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata.egg-info/requires.txt
RENAMED
|
File without changes
|
{napari-spatialdata-0.4.0 → napari-spatialdata-0.4.1}/src/napari_spatialdata.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|