Skip to content

Commit

Permalink
Fix spatialdata sdata_store bug (#398)
Browse files Browse the repository at this point in the history
* Fix bug

* Lint
  • Loading branch information
keller-mark authored Jan 14, 2025
1 parent 823e00b commit 36f1e50
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "vitessce"
version = "3.5.0"
version = "3.5.1"
authors = [
{ name="Mark Keller", email="[email protected]" },
]
Expand Down
15 changes: 12 additions & 3 deletions src/vitessce/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@ def get_uid_str(uid):
signal: AbortSignal.timeout(invokeTimeout),
});
if (!data.success) return undefined;
if (key.includes("spatialdata_attrs") && key.endsWith("0") && !ArrayBuffer.isView(buffers[0].buffer)) {
// For some reason, the Zarrita.js UnicodeStringArray does not seem to work with
// ArrayBuffers (throws a TypeError), so here we convert to Uint8Array if needed.
// This error is occurring specifically for the arr.getChunk call within the AnnDataSource._loadString function.
// TODO: figure out a more long-term solution.
return new Uint8Array(buffers[0].buffer);
}
return buffers[0].buffer;
},
}
Expand Down Expand Up @@ -454,7 +463,7 @@ class VitessceWidget(anywidget.AnyWidget):

next_port = DEFAULT_PORT

js_package_version = Unicode('3.4.14').tag(sync=True)
js_package_version = Unicode('3.5.4').tag(sync=True)
js_dev_mode = Bool(False).tag(sync=True)
custom_js_url = Unicode('').tag(sync=True)
plugin_esm = List(trait=Unicode(''), default_value=[]).tag(sync=True)
Expand All @@ -463,7 +472,7 @@ class VitessceWidget(anywidget.AnyWidget):

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

def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.4.14', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, invoke_timeout=30000):
def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.5.4', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, invoke_timeout=30000):
"""
Construct a new Vitessce widget.
Expand Down Expand Up @@ -576,7 +585,7 @@ def _plugin_command(self, params, buffers):
# Launch Vitessce using plain HTML representation (no ipywidgets)


def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.4.14', js_dev_mode=False, custom_js_url='', plugin_esm=DEFAULT_PLUGIN_ESM, remount_on_uid_change=True):
def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.5.4', js_dev_mode=False, custom_js_url='', plugin_esm=DEFAULT_PLUGIN_ESM, remount_on_uid_change=True):
from IPython.display import display, HTML
uid_str = "vitessce" + get_uid_str(uid)

Expand Down

0 comments on commit 36f1e50

Please sign in to comment.