vitessce 3.7.3__tar.gz → 3.7.5__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 (49) hide show
  1. {vitessce-3.7.3 → vitessce-3.7.5}/PKG-INFO +1 -1
  2. {vitessce-3.7.3 → vitessce-3.7.5}/pyproject.toml +1 -1
  3. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/config.py +1 -0
  4. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/file_def_utils.py +12 -0
  5. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/widget.py +12 -10
  6. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/wrappers.py +6 -1
  7. {vitessce-3.7.3 → vitessce-3.7.5}/uv.lock +1 -1
  8. {vitessce-3.7.3 → vitessce-3.7.5}/.coveragerc_omit +0 -0
  9. {vitessce-3.7.3 → vitessce-3.7.5}/.coveragerc_real +0 -0
  10. {vitessce-3.7.3 → vitessce-3.7.5}/.devcontainer/devcontainer.json +0 -0
  11. {vitessce-3.7.3 → vitessce-3.7.5}/.gitignore +0 -0
  12. {vitessce-3.7.3 → vitessce-3.7.5}/.python-version +0 -0
  13. {vitessce-3.7.3 → vitessce-3.7.5}/CHANGELOG.md +0 -0
  14. {vitessce-3.7.3 → vitessce-3.7.5}/LICENSE +0 -0
  15. {vitessce-3.7.3 → vitessce-3.7.5}/MANIFEST.in +0 -0
  16. {vitessce-3.7.3 → vitessce-3.7.5}/Makefile +0 -0
  17. {vitessce-3.7.3 → vitessce-3.7.5}/README.md +0 -0
  18. {vitessce-3.7.3 → vitessce-3.7.5}/setup.cfg +0 -0
  19. {vitessce-3.7.3 → vitessce-3.7.5}/setup.py +0 -0
  20. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/__init__.py +0 -0
  21. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/config_converter.py +0 -0
  22. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/constants.py +0 -0
  23. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/data_utils/__init__.py +0 -0
  24. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/data_utils/anndata.py +0 -0
  25. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/data_utils/entities.py +0 -0
  26. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/data_utils/multivec.py +0 -0
  27. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/data_utils/ome.py +0 -0
  28. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/export.py +0 -0
  29. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/repr.py +0 -0
  30. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/responses.py +0 -0
  31. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/routes.py +0 -0
  32. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/utils.py +0 -0
  33. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/widget_plugins/__init__.py +0 -0
  34. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/widget_plugins/demo_plugin.py +0 -0
  35. {vitessce-3.7.3 → vitessce-3.7.5}/src/vitessce/widget_plugins/spatial_query.py +0 -0
  36. {vitessce-3.7.3 → vitessce-3.7.5}/tests/__init__.py +0 -0
  37. {vitessce-3.7.3 → vitessce-3.7.5}/tests/create_test_data.py +0 -0
  38. {vitessce-3.7.3 → vitessce-3.7.5}/tests/data/test.ome.tif +0 -0
  39. {vitessce-3.7.3 → vitessce-3.7.5}/tests/test_anndata_utils.py +0 -0
  40. {vitessce-3.7.3 → vitessce-3.7.5}/tests/test_config.py +0 -0
  41. {vitessce-3.7.3 → vitessce-3.7.5}/tests/test_config_converter.py +0 -0
  42. {vitessce-3.7.3 → vitessce-3.7.5}/tests/test_config_updates.py +0 -0
  43. {vitessce-3.7.3 → vitessce-3.7.5}/tests/test_entities.py +0 -0
  44. {vitessce-3.7.3 → vitessce-3.7.5}/tests/test_ome_utils.py +0 -0
  45. {vitessce-3.7.3 → vitessce-3.7.5}/tests/test_wrappers.py +0 -0
  46. {vitessce-3.7.3 → vitessce-3.7.5}/tests-widget/example.spec.js +0 -0
  47. {vitessce-3.7.3 → vitessce-3.7.5}/tests-widget/package.json +0 -0
  48. {vitessce-3.7.3 → vitessce-3.7.5}/tests-widget/playwright.config.js +0 -0
  49. {vitessce-3.7.3 → vitessce-3.7.5}/tests-widget/pnpm-lock.yaml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vitessce
3
- Version: 3.7.3
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>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "vitessce"
7
- version = "3.7.3"
7
+ version = "3.7.5"
8
8
  authors = [
9
9
  { name="Mark Keller", email="mark_keller@hms.harvard.edu" },
10
10
  ]
@@ -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
@@ -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'] = {
@@ -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.6.18').tag(sync=True)
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.6.18', 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):
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.6.18', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, page_mode=False, page_esm=None):
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]
@@ -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 = {
@@ -4496,7 +4496,7 @@ wheels = [
4496
4496
 
4497
4497
  [[package]]
4498
4498
  name = "vitessce"
4499
- version = "3.7.3"
4499
+ version = "3.7.5"
4500
4500
  source = { editable = "." }
4501
4501
  dependencies = [
4502
4502
  { name = "black" },
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