Skip to content

Commit 5aa7412

Browse files
authored
Updated version and added zip support (#464)
* Updated version and added zip support * Wrapper changes added * Version update in Widget
1 parent a6bd970 commit 5aa7412

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "vitessce"
7-
version = "3.7.0"
7+
version = "3.7.1"
88
authors = [
99
{ name="Mark Keller", email="[email protected]" },
1010
]

src/vitessce/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ class FileType(DocEnum):
163163
"""
164164
ANNDATA_ZARR = "anndata.zarr", "Joint file type for AnnData objects"
165165
SPATIALDATA_ZARR = "spatialdata.zarr", "Joint file type for SpatialData objects"
166+
SPATIALDATA_ZARR_ZIP = "spatialdata.zarr.zip", "Joint file type for SpatialData objects in a Zarr directory store that has been zipped"
166167
ANNDATA_H5AD = "anndata.h5ad", "Joint file type for AnnData objects"
167168
ANNDATA_ZARR_ZIP = "anndata.zarr.zip", "Joint file type for AnnData object in a Zarr directory store that has been zipped"
168169
OBS_EMBEDDING_CSV = 'obsEmbedding.csv', "File type for obsEmbedding values stored in a CSV file"

src/vitessce/widget.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ class VitessceWidget(anywidget.AnyWidget):
650650

651651
next_port = DEFAULT_PORT
652652

653-
js_package_version = Unicode('3.6.12').tag(sync=True)
653+
js_package_version = Unicode('3.6.13').tag(sync=True)
654654
js_dev_mode = Bool(False).tag(sync=True)
655655
custom_js_url = Unicode('').tag(sync=True)
656656
plugin_esm = List(trait=Unicode(''), default_value=[]).tag(sync=True)
@@ -663,8 +663,7 @@ class VitessceWidget(anywidget.AnyWidget):
663663

664664
store_urls = List(trait=Unicode(''), default_value=[]).tag(sync=True)
665665

666-
def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.6.12', 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-
""" """
666+
def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.6.13', 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):
668667
"""
669668
Construct a new Vitessce widget. Not intended to be instantiated directly; instead, use ``VitessceConfig.widget``.
670669
@@ -797,7 +796,7 @@ def _plugin_command(self, params, buffers):
797796
# Launch Vitessce using plain HTML representation (no ipywidgets)
798797

799798

800-
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.12', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, page_mode=False, page_esm=None):
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.13', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, page_mode=False, page_esm=None):
801800
from IPython.display import display, HTML
802801
uid_str = "vitessce" + get_uid_str(uid)
803802

src/vitessce/wrappers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ def auto_view_config(self, vc):
13991399

14001400
class SpatialDataWrapper(AnnDataWrapper):
14011401

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", coordination_values=None, **kwargs):
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):
14031403
"""
14041404
Wrap a SpatialData object.
14051405
@@ -1415,6 +1415,7 @@ def __init__(self, sdata_path: Optional[str] = None, sdata_url: Optional[str] =
14151415
:type image_path: Optional[str]
14161416
:param coordinate_system: Name of a target coordinate system.
14171417
:type coordinate_system: Optional[str]
1418+
:param is_zip: Boolean indicating whether the Zarr store is in a zipped format.
14181419
:param affine_transformation: Transformation to be applied to the image. By default, None. Prefer coordinate_system.
14191420
:type affine_transformation: Optional[np.ndarray]
14201421
:param obs_spots_path: Location of shapes that should be interpreted as spot observations, by default None
@@ -1434,7 +1435,7 @@ def __init__(self, sdata_path: Optional[str] = None, sdata_url: Optional[str] =
14341435
kwargs.get('adata_store', None),
14351436
kwargs.get('adata_artifact', None)
14361437
])
1437-
super().__init__(adata_path=sdata_path, adata_url=sdata_url, adata_store=sdata_store, adata_artifact=sdata_artifact, **kwargs)
1438+
super().__init__(adata_path=sdata_path, adata_url=sdata_url, adata_store=sdata_store, adata_artifact=sdata_artifact, is_zip=is_zip, **kwargs)
14381439
if "labels_path" in kwargs:
14391440
warnings.warn("`labels_path` is deprecated. Use `obs_segmentations_path` instead.", DeprecationWarning)
14401441
self._obs_segmentations_path = kwargs["labels_path"]
@@ -1540,7 +1541,7 @@ def generator(base_url):
15401541
options = gen_feature_labels_schema(self._feature_labels, options)
15411542
if len(options.keys()) > 0:
15421543
obj_file_def = {
1543-
"fileType": ft.SPATIALDATA_ZARR.value,
1544+
"fileType": ft.SPATIALDATA_ZARR_ZIP.value if self.is_zip else ft.SPATIALDATA_ZARR.value,
15441545
"url": self.get_zarr_url(base_url, dataset_uid, obj_i),
15451546
"options": options
15461547
}

0 commit comments

Comments
 (0)