vitessce 3.7.3__py3-none-any.whl → 3.7.5__py3-none-any.whl
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.
- vitessce/config.py +1 -0
- vitessce/file_def_utils.py +12 -0
- vitessce/widget.py +12 -10
- vitessce/wrappers.py +6 -1
- {vitessce-3.7.3.dist-info → vitessce-3.7.5.dist-info}/METADATA +1 -1
- {vitessce-3.7.3.dist-info → vitessce-3.7.5.dist-info}/RECORD +8 -8
- {vitessce-3.7.3.dist-info → vitessce-3.7.5.dist-info}/WHEEL +0 -0
- {vitessce-3.7.3.dist-info → vitessce-3.7.5.dist-info}/licenses/LICENSE +0 -0
vitessce/config.py
CHANGED
|
@@ -1815,6 +1815,7 @@ class VitessceConfig:
|
|
|
1815
1815
|
:param bool page_mode: Whether to render the <Vitessce/> component in grid-mode or page-mode. By default, False.
|
|
1816
1816
|
:param str page_esm: The ES module string for the page component creation function. Optional.
|
|
1817
1817
|
:param bool prevent_scroll: Should mouseover in the Vitessce widget prevent disable the scrolling of the notebook? By default, True.
|
|
1818
|
+
:param str server_host: The host to which the Uvicorn server should bind. Specify "0.0.0.0" to bind to all interfaces. By default, "127.0.0.1".
|
|
1818
1819
|
|
|
1819
1820
|
:returns: The Jupyter widget.
|
|
1820
1821
|
:rtype: VitessceWidget
|
vitessce/file_def_utils.py
CHANGED
|
@@ -147,6 +147,18 @@ def gen_sdata_obs_segmentations_schema(options, path: str, table_path: str = "ta
|
|
|
147
147
|
return options
|
|
148
148
|
|
|
149
149
|
|
|
150
|
+
def gen_sdata_obs_points_schema(options, path: str, table_path: str = "tables/table", coordinate_system: Optional[str] = None) -> dict:
|
|
151
|
+
if path is not None:
|
|
152
|
+
options["obsPoints"] = {
|
|
153
|
+
"path": path
|
|
154
|
+
}
|
|
155
|
+
if table_path is not None:
|
|
156
|
+
options["obsPoints"]['tablePath'] = table_path
|
|
157
|
+
if coordinate_system is not None:
|
|
158
|
+
options["obsPoints"]['coordinateSystem'] = coordinate_system
|
|
159
|
+
return options
|
|
160
|
+
|
|
161
|
+
|
|
150
162
|
def gen_sdata_obs_spots_schema(options: dict, shapes_path: str, table_path: str = "tables/table", region: Optional[str] = None, coordinate_system: Optional[str] = None) -> dict:
|
|
151
163
|
if shapes_path is not None:
|
|
152
164
|
options['obsSpots'] = {
|
vitessce/widget.py
CHANGED
|
@@ -40,7 +40,7 @@ class BackgroundServer:
|
|
|
40
40
|
self.thread = None
|
|
41
41
|
return self
|
|
42
42
|
|
|
43
|
-
def start(self, port=None, timeout=1, daemon=True, log_level="warning"):
|
|
43
|
+
def start(self, port=None, host=None, timeout=1, daemon=True, log_level="warning"):
|
|
44
44
|
from uvicorn import Config, Server
|
|
45
45
|
from threading import Thread
|
|
46
46
|
|
|
@@ -50,6 +50,7 @@ class BackgroundServer:
|
|
|
50
50
|
config = Config(
|
|
51
51
|
app=self.app,
|
|
52
52
|
port=port,
|
|
53
|
+
host=(host if host is not None else "127.0.0.1"),
|
|
53
54
|
timeout_keep_alive=timeout,
|
|
54
55
|
log_level=log_level
|
|
55
56
|
)
|
|
@@ -117,15 +118,15 @@ def get_base_url_and_port(port, next_port, proxy=False, base_url=None, host_name
|
|
|
117
118
|
return base_url, use_port, next_port
|
|
118
119
|
|
|
119
120
|
|
|
120
|
-
def serve_routes(config, routes, use_port):
|
|
121
|
+
def serve_routes(config, routes, use_port, server_host):
|
|
121
122
|
if not config.has_server(use_port) and len(routes) > 0:
|
|
122
123
|
server = BackgroundServer(routes)
|
|
123
124
|
config.register_server(use_port, server)
|
|
124
125
|
data_server.register(config)
|
|
125
|
-
server.start(port=use_port)
|
|
126
|
+
server.start(port=use_port, host=server_host)
|
|
126
127
|
|
|
127
128
|
|
|
128
|
-
def launch_vitessce_io(config, theme='light', port=None, base_url=None, host_name=None, proxy=False, open=True):
|
|
129
|
+
def launch_vitessce_io(config, theme='light', port=None, base_url=None, host_name=None, proxy=False, open=True, server_host=None):
|
|
129
130
|
import webbrowser
|
|
130
131
|
base_url, use_port, _ = get_base_url_and_port(
|
|
131
132
|
port, DEFAULT_PORT, proxy=proxy, base_url=base_url, host_name=host_name)
|
|
@@ -136,7 +137,7 @@ def launch_vitessce_io(config, theme='light', port=None, base_url=None, host_nam
|
|
|
136
137
|
if len(stores) > 0:
|
|
137
138
|
raise ValueError('One or more files in this configuration have been provided via Zarr store, which can only be loaded via the widget. Either use VitessceConfig.widget or VitessceConfig.display (instead of .web_app), or provide the files via _path or _url (rather than _store) parameters.')
|
|
138
139
|
|
|
139
|
-
serve_routes(config, routes, use_port)
|
|
140
|
+
serve_routes(config, routes, use_port, server_host)
|
|
140
141
|
vitessce_url = f"http://vitessce.io/#?theme={theme}&url=data:," + quote_plus(
|
|
141
142
|
json.dumps(config_dict))
|
|
142
143
|
if open:
|
|
@@ -650,7 +651,7 @@ class VitessceWidget(anywidget.AnyWidget):
|
|
|
650
651
|
|
|
651
652
|
next_port = DEFAULT_PORT
|
|
652
653
|
|
|
653
|
-
js_package_version = Unicode('3.
|
|
654
|
+
js_package_version = Unicode('3.8.3').tag(sync=True)
|
|
654
655
|
js_dev_mode = Bool(False).tag(sync=True)
|
|
655
656
|
custom_js_url = Unicode('').tag(sync=True)
|
|
656
657
|
plugin_esm = List(trait=Unicode(''), default_value=[]).tag(sync=True)
|
|
@@ -663,7 +664,7 @@ class VitessceWidget(anywidget.AnyWidget):
|
|
|
663
664
|
|
|
664
665
|
store_urls = List(trait=Unicode(''), default_value=[]).tag(sync=True)
|
|
665
666
|
|
|
666
|
-
def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.
|
|
667
|
+
def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.8.3', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, prefer_local=True, invoke_timeout=300000, invoke_batched=True, page_mode=False, page_esm=None, prevent_scroll=True, server_host=None):
|
|
667
668
|
"""
|
|
668
669
|
Construct a new Vitessce widget. Not intended to be instantiated directly; instead, use ``VitessceConfig.widget``.
|
|
669
670
|
|
|
@@ -684,6 +685,7 @@ class VitessceWidget(anywidget.AnyWidget):
|
|
|
684
685
|
:param bool page_mode: Whether to render the <Vitessce/> component in grid-mode or page-mode. By default, False.
|
|
685
686
|
:param str page_esm: The ES module string for the page component creation function. Optional.
|
|
686
687
|
:param bool prevent_scroll: Should mouseover in the Vitessce widget prevent disable the scrolling of the notebook? By default, True.
|
|
688
|
+
:param str server_host: The host to which the Uvicorn server should bind. Specify "0.0.0.0" to bind to all interfaces. By default, "127.0.0.1".
|
|
687
689
|
|
|
688
690
|
Note: these parameter docstrings need to be manually kept in sync with the VitessceConfig.widget docstring.
|
|
689
691
|
"""
|
|
@@ -732,7 +734,7 @@ class VitessceWidget(anywidget.AnyWidget):
|
|
|
732
734
|
|
|
733
735
|
self.observe(handle_config_change, names=['_config'])
|
|
734
736
|
|
|
735
|
-
serve_routes(config, routes, use_port)
|
|
737
|
+
serve_routes(config, routes, use_port, server_host)
|
|
736
738
|
|
|
737
739
|
def _get_coordination_value(self, coordination_type, coordination_scope):
|
|
738
740
|
obj = self._config['coordinationSpace'][coordination_type]
|
|
@@ -796,7 +798,7 @@ class VitessceWidget(anywidget.AnyWidget):
|
|
|
796
798
|
# Launch Vitessce using plain HTML representation (no ipywidgets)
|
|
797
799
|
|
|
798
800
|
|
|
799
|
-
def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.
|
|
801
|
+
def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.8.3', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, page_mode=False, page_esm=None, server_host=None):
|
|
800
802
|
from IPython.display import display, HTML
|
|
801
803
|
uid_str = "vitessce" + get_uid_str(uid)
|
|
802
804
|
|
|
@@ -804,7 +806,7 @@ def ipython_display(config, height=600, theme='auto', base_url=None, host_name=N
|
|
|
804
806
|
port, DEFAULT_PORT, proxy=proxy, base_url=base_url, host_name=host_name)
|
|
805
807
|
config_dict = config.to_dict(base_url=base_url)
|
|
806
808
|
routes = config.get_routes()
|
|
807
|
-
serve_routes(config, routes, use_port)
|
|
809
|
+
serve_routes(config, routes, use_port, server_host)
|
|
808
810
|
|
|
809
811
|
plugins = plugins or []
|
|
810
812
|
plugin_esm = [p.plugin_esm for p in plugins]
|
vitessce/wrappers.py
CHANGED
|
@@ -28,6 +28,7 @@ from vitessce.file_def_utils import (
|
|
|
28
28
|
gen_obs_sets_schema,
|
|
29
29
|
gen_sdata_image_schema,
|
|
30
30
|
gen_sdata_obs_segmentations_schema,
|
|
31
|
+
gen_sdata_obs_points_schema,
|
|
31
32
|
gen_sdata_obs_spots_schema,
|
|
32
33
|
gen_sdata_obs_sets_schema,
|
|
33
34
|
gen_sdata_obs_feature_matrix_schema,
|
|
@@ -1399,7 +1400,7 @@ SpatialDataWrapperType = TypeVar('SpatialDataWrapperType', bound='SpatialDataWra
|
|
|
1399
1400
|
|
|
1400
1401
|
class SpatialDataWrapper(AnnDataWrapper):
|
|
1401
1402
|
|
|
1402
|
-
def __init__(self, sdata_path: Optional[str] = None, sdata_url: Optional[str] = None, sdata_store: Optional[Union[str, zarr.storage.StoreLike]] = None, sdata_artifact: Optional[ln.Artifact] = None, image_path: Optional[str] = None, region: Optional[str] = None, coordinate_system: Optional[str] = None, obs_spots_path: Optional[str] = None, obs_segmentations_path: Optional[str] = None, table_path: str = "tables/table", is_zip=None, coordination_values=None, **kwargs):
|
|
1403
|
+
def __init__(self, sdata_path: Optional[str] = None, sdata_url: Optional[str] = None, sdata_store: Optional[Union[str, zarr.storage.StoreLike]] = None, sdata_artifact: Optional[ln.Artifact] = None, image_path: Optional[str] = None, region: Optional[str] = None, coordinate_system: Optional[str] = None, obs_spots_path: Optional[str] = None, obs_segmentations_path: Optional[str] = None, obs_points_path: Optional[str] = None, table_path: str = "tables/table", is_zip=None, coordination_values=None, **kwargs):
|
|
1403
1404
|
"""
|
|
1404
1405
|
Wrap a SpatialData object.
|
|
1405
1406
|
|
|
@@ -1422,6 +1423,8 @@ class SpatialDataWrapper(AnnDataWrapper):
|
|
|
1422
1423
|
:type obs_spots_path: Optional[str]
|
|
1423
1424
|
:param obs_segmentations_path: Path to a labels or shapes element (segmentation bitmask label image or segmentation polygon shapes), by default None
|
|
1424
1425
|
:type obs_segmentations_path: Optional[str]
|
|
1426
|
+
:param obs_points_path: Path to a points element, by default None
|
|
1427
|
+
:type obs_points_path: Optional[str]
|
|
1425
1428
|
"""
|
|
1426
1429
|
raise_error_if_zero_or_more_than_one([
|
|
1427
1430
|
sdata_path,
|
|
@@ -1451,6 +1454,7 @@ class SpatialDataWrapper(AnnDataWrapper):
|
|
|
1451
1454
|
self._kwargs = kwargs
|
|
1452
1455
|
self._obs_spots_path = obs_spots_path
|
|
1453
1456
|
self._obs_segmentations_path = obs_segmentations_path
|
|
1457
|
+
self._obs_points_path = obs_points_path
|
|
1454
1458
|
if self._adata_path is not None:
|
|
1455
1459
|
self.zarr_folder = 'spatialdata.zarr'
|
|
1456
1460
|
self.obs_type_label = None
|
|
@@ -1538,6 +1542,7 @@ class SpatialDataWrapper(AnnDataWrapper):
|
|
|
1538
1542
|
options = gen_sdata_obs_spots_schema(options, self._obs_spots_path, self._table_path, self._region, self._coordinate_system)
|
|
1539
1543
|
options = gen_sdata_image_schema(options, self._image_path, self._coordinate_system)
|
|
1540
1544
|
options = gen_sdata_obs_segmentations_schema(options, self._obs_segmentations_path, self._table_path, self._coordinate_system)
|
|
1545
|
+
options = gen_sdata_obs_points_schema(options, self._obs_points_path, self._table_path, self._coordinate_system)
|
|
1541
1546
|
options = gen_feature_labels_schema(self._feature_labels, options)
|
|
1542
1547
|
if len(options.keys()) > 0:
|
|
1543
1548
|
obj_file_def = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vitessce
|
|
3
|
-
Version: 3.7.
|
|
3
|
+
Version: 3.7.5
|
|
4
4
|
Summary: Jupyter widget facilitating interactive visualization of spatial single-cell data with Vitessce
|
|
5
5
|
Project-URL: repository, https://github.com/vitessce/vitessce-python
|
|
6
6
|
Author-email: Mark Keller <mark_keller@hms.harvard.edu>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
vitessce/__init__.py,sha256=GWGahpQMOGFotQXilRccGT0Bnn3OyoCQUCUphW_DtTI,1632
|
|
2
|
-
vitessce/config.py,sha256=
|
|
2
|
+
vitessce/config.py,sha256=vZyxrvzsrDpbp3QMcfOZghSO-kSb4myUbRNTGl6Ur6o,83101
|
|
3
3
|
vitessce/config_converter.py,sha256=IRPnGPGaETvJbYZNUv2pe54SHHHsDY9VWo3JRjSI5FM,14681
|
|
4
4
|
vitessce/constants.py,sha256=7w71Z5TLJIWy7ieNxTmNaC-KB3G5mok_U0tTrcUG6g4,15500
|
|
5
5
|
vitessce/export.py,sha256=L7j5sVC0nBSqGocFWQyyHImSiAF4IjXhmqV1QtpuNc4,3874
|
|
6
|
-
vitessce/file_def_utils.py,sha256=
|
|
6
|
+
vitessce/file_def_utils.py,sha256=uAYRSePwhtow0l1izxzxRLqAuLYEKoWvx2cZ3F24CsI,7147
|
|
7
7
|
vitessce/repr.py,sha256=qMmefmZ3E-3sRVxeI5q1DTZnfuwbXKiA85eyqk5MCT4,2287
|
|
8
8
|
vitessce/responses.py,sha256=Z6Wo4AXN-RyzmxMPhSuhpIsHTItHM4GyIgMLGoVEYcU,339
|
|
9
9
|
vitessce/routes.py,sha256=U8T-L-3QCD_tAbPF8LsUlSMhPWNbyzbLNUnxP9Z9s9o,2140
|
|
10
10
|
vitessce/utils.py,sha256=obzjj65qsagu60_yuhGc-0jmHO-BW0Y-bDs0FgrBqLY,981
|
|
11
|
-
vitessce/widget.py,sha256=
|
|
12
|
-
vitessce/wrappers.py,sha256=
|
|
11
|
+
vitessce/widget.py,sha256=QJKneYYvBl_WdLiWo1jDaSYlqsc8UXnXtlJRBqj3yjw,36228
|
|
12
|
+
vitessce/wrappers.py,sha256=BcT5hyX0iEIWFxPLKeaXy3PM5yz4WZqqq0AUYPIe4cQ,76621
|
|
13
13
|
vitessce/data_utils/__init__.py,sha256=3mWi1lMjoj4_dNbhMOvyE-HEJu0qpMzcmkhfz_5T6n8,361
|
|
14
14
|
vitessce/data_utils/anndata.py,sha256=iLa5-bRezHgBzL_XCHO7w0pc0RQ4urzZbDsqJbBYeCk,10668
|
|
15
15
|
vitessce/data_utils/entities.py,sha256=X8enC_TQbgwBzjgD1x53IPS6aVr9wyP0s-NLuYBeMeU,11705
|
|
@@ -18,7 +18,7 @@ vitessce/data_utils/ome.py,sha256=te1X933QTRfCm8N5uVXZREShtxDdAEggZZKKEoJdlhU,55
|
|
|
18
18
|
vitessce/widget_plugins/__init__.py,sha256=lto2GXnc7KwjIoT-jvzyRYLj0XTJG3uxoX45Hc9EcWA,82
|
|
19
19
|
vitessce/widget_plugins/demo_plugin.py,sha256=14S7nOxdlKSxIHw9DUcNCN83NE_U1EMPy2D4k0FDues,1797
|
|
20
20
|
vitessce/widget_plugins/spatial_query.py,sha256=CYxvmMT1Je_jguikPROQxlegkPgIIzemKGbZSJfZMyI,12314
|
|
21
|
-
vitessce-3.7.
|
|
22
|
-
vitessce-3.7.
|
|
23
|
-
vitessce-3.7.
|
|
24
|
-
vitessce-3.7.
|
|
21
|
+
vitessce-3.7.5.dist-info/METADATA,sha256=6eoLOe4wlXUcAEi8hjlBQHp-l5K_XI5MTmTItxJWD_0,9826
|
|
22
|
+
vitessce-3.7.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
23
|
+
vitessce-3.7.5.dist-info/licenses/LICENSE,sha256=sNNpI0PQ57AW8_XnTAjU5Yw8YBA_DRNkVHrHYpCIhRU,1067
|
|
24
|
+
vitessce-3.7.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|