From ee574c6aa42731f26a61193594e38295be127de7 Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Fri, 19 Jul 2024 15:36:06 -0400 Subject: [PATCH 1/2] feat: Migrate to zarrita in Python bindings --- python/src/vizarr/_widget.js | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/python/src/vizarr/_widget.js b/python/src/vizarr/_widget.js index 8a515e7..180c468 100644 --- a/python/src/vizarr/_widget.js +++ b/python/src/vizarr/_widget.js @@ -42,30 +42,18 @@ function get_source(model, source) { return { /** * @param {string} key - * @return {Promise} + * @return {Promise} */ - async getItem(key) { + async get(key) { const { data, buffers } = await send(model, { type: "get", source_id: source.id, key, }); if (!data.success) { - throw { __zarr__: "KeyError" }; + return undefined; } - return buffers[0].buffer; - }, - /** - * @param {string} key - * @return {Promise} - */ - async containsItem(key) { - const { data } = await send(model, { - type: "has", - source_id: source.id, - key, - }); - return data; + return new Uint8Array(buffers[0].buffer); }, }; } From 1cb08c75a0c5f8a7b3b26e9608f84febeacc19da Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Fri, 19 Jul 2024 15:36:38 -0400 Subject: [PATCH 2/2] chore: Bump v0.1.0 --- python/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index be59d8a..39a3a64 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "vizarr" -version = "0.0.3" +version = "0.1.0" dependencies = ["anywidget", "zarr"] [project.optional-dependencies]