Skip to content

Commit a358067

Browse files
authored
Versions of anndata, anywidget, JS package (#328)
* Versions of anndata and anywidget * Update test * Revert numeric changes
1 parent 3810797 commit a358067

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies = [
3232
'pandas>=1.1.2',
3333
'black>=21.11b1',
3434
'numpy>=1.21.2',
35-
'anndata>=0.7.8,<0.9',
35+
'anndata>=0.7.8,<0.11',
3636
'scanpy>=1.9.3',
3737
'ome-zarr==0.8.3',
3838
'tifffile>=2020.10.1',
@@ -73,7 +73,7 @@ docs = [
7373
]
7474
all = [
7575
'jupyter-server-proxy>=1.5.2',
76-
'anywidget==0.4.2',
76+
'anywidget>=0.9.3',
7777
'uvicorn>=0.17.0',
7878
'ujson>=4.0.1',
7979
'starlette==0.14.0',

tests/test_anndata_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ def test_to_uint8(self):
8484
def test_to_uint8_global_norm(self):
8585
adata = self.adata
8686
norm_X = to_uint8(adata.X, norm_along="global")
87-
assert norm_X.tolist() == [[255, 200, 250], [250, 50, 255], [104, 50, 100], [200, 70, 205]]
87+
np.testing.assert_almost_equal(norm_X.tolist(), [[255, 200, 250], [250, 50, 255], [104, 50, 100], [200, 70, 205]], decimal=0)
8888

8989
def test_to_uint8_gene_norm(self):
9090
adata = self.adata
9191
norm_X = to_uint8(adata.X, norm_along="var")
92-
assert norm_X.tolist() == [[255, 255, 246], [246, 0, 254], [0, 0, 0], [161, 33, 172]]
92+
np.testing.assert_almost_equal(norm_X.tolist(), [[255, 255, 246], [246, 0, 254], [0, 0, 0], [161, 33, 172]], decimal=0)
9393

9494
def test_to_uint8_cell_norm(self):
9595
adata = self.adata

vitessce/widget.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def get_uid_str(uid):
194194
};
195195
}
196196
197-
export async function render(view) {
197+
async function render(view) {
198198
const cssUid = view.model.get('uid');
199199
const jsDevMode = view.model.get('js_dev_mode');
200200
const jsPackageVersion = view.model.get('js_package_version');
@@ -339,6 +339,7 @@ def get_uid_str(uid):
339339
}
340340
};
341341
}
342+
export default { render };
342343
"""
343344

344345
DEFAULT_PLUGIN_ESM = """
@@ -382,13 +383,13 @@ class VitessceWidget(anywidget.AnyWidget):
382383

383384
next_port = DEFAULT_PORT
384385

385-
js_package_version = Unicode('3.3.6').tag(sync=True)
386+
js_package_version = Unicode('3.3.7').tag(sync=True)
386387
js_dev_mode = Bool(False).tag(sync=True)
387388
custom_js_url = Unicode('').tag(sync=True)
388389
plugin_esm = Unicode(DEFAULT_PLUGIN_ESM).tag(sync=True)
389390
remount_on_uid_change = Bool(True).tag(sync=True)
390391

391-
def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.3.6', js_dev_mode=False, custom_js_url='', plugin_esm=DEFAULT_PLUGIN_ESM, remount_on_uid_change=True):
392+
def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.3.7', js_dev_mode=False, custom_js_url='', plugin_esm=DEFAULT_PLUGIN_ESM, remount_on_uid_change=True):
392393
"""
393394
Construct a new Vitessce widget.
394395
@@ -462,7 +463,7 @@ def close(self):
462463
# Launch Vitessce using plain HTML representation (no ipywidgets)
463464

464465

465-
def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.3.6', js_dev_mode=False, custom_js_url='', plugin_esm=DEFAULT_PLUGIN_ESM, remount_on_uid_change=True):
466+
def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.3.7', js_dev_mode=False, custom_js_url='', plugin_esm=DEFAULT_PLUGIN_ESM, remount_on_uid_change=True):
466467
from IPython.display import display, HTML
467468
uid_str = "vitessce" + get_uid_str(uid)
468469

0 commit comments

Comments
 (0)