Skip to content

Commit

Permalink
Versions of anndata, anywidget, JS package (#328)
Browse files Browse the repository at this point in the history
* Versions of anndata and anywidget

* Update test

* Revert numeric changes
  • Loading branch information
keller-mark authored Mar 13, 2024
1 parent 3810797 commit a358067
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [
'pandas>=1.1.2',
'black>=21.11b1',
'numpy>=1.21.2',
'anndata>=0.7.8,<0.9',
'anndata>=0.7.8,<0.11',
'scanpy>=1.9.3',
'ome-zarr==0.8.3',
'tifffile>=2020.10.1',
Expand Down Expand Up @@ -73,7 +73,7 @@ docs = [
]
all = [
'jupyter-server-proxy>=1.5.2',
'anywidget==0.4.2',
'anywidget>=0.9.3',
'uvicorn>=0.17.0',
'ujson>=4.0.1',
'starlette==0.14.0',
Expand Down
4 changes: 2 additions & 2 deletions tests/test_anndata_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ def test_to_uint8(self):
def test_to_uint8_global_norm(self):
adata = self.adata
norm_X = to_uint8(adata.X, norm_along="global")
assert norm_X.tolist() == [[255, 200, 250], [250, 50, 255], [104, 50, 100], [200, 70, 205]]
np.testing.assert_almost_equal(norm_X.tolist(), [[255, 200, 250], [250, 50, 255], [104, 50, 100], [200, 70, 205]], decimal=0)

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

def test_to_uint8_cell_norm(self):
adata = self.adata
Expand Down
9 changes: 5 additions & 4 deletions vitessce/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def get_uid_str(uid):
};
}
export async function render(view) {
async function render(view) {
const cssUid = view.model.get('uid');
const jsDevMode = view.model.get('js_dev_mode');
const jsPackageVersion = view.model.get('js_package_version');
Expand Down Expand Up @@ -339,6 +339,7 @@ def get_uid_str(uid):
}
};
}
export default { render };
"""

DEFAULT_PLUGIN_ESM = """
Expand Down Expand Up @@ -382,13 +383,13 @@ class VitessceWidget(anywidget.AnyWidget):

next_port = DEFAULT_PORT

js_package_version = Unicode('3.3.6').tag(sync=True)
js_package_version = Unicode('3.3.7').tag(sync=True)
js_dev_mode = Bool(False).tag(sync=True)
custom_js_url = Unicode('').tag(sync=True)
plugin_esm = Unicode(DEFAULT_PLUGIN_ESM).tag(sync=True)
remount_on_uid_change = Bool(True).tag(sync=True)

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):
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):
"""
Construct a new Vitessce widget.
Expand Down Expand Up @@ -462,7 +463,7 @@ def close(self):
# 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.3.6', 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.3.7', 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 a358067

Please sign in to comment.