Context
- Affected library: Webknossos CLI
Trying to convert a Zarr dataset to WBK dataset using webknossos convert-zarr
Current Behavior
The path to the Zarr dataset is converted to a UPath before being opened with Tensorstore.
UPath cannot be serialised to JSON and throws an error:
return tensorstore.open(
TypeError: Object does not support conversion to JSON
When in the except clause the wrong exception is caught:
except tensorstore.TensorStoreError:
AttributeError: module 'tensorstore' has no attribute 'TensorStoreError'.
Steps to Reproduce the bug
def _try_open_zarr(path: UPath) -> tensorstore.TensorStore:
try:
return tensorstore.open(
{"driver": "zarr3", "kvstore": {"driver": "file", "path": path}}
).result()
except tensorstore.TensorStoreError:
return tensorstore.open(
{"driver": "zarr", "kvstore": {"driver": "file", "path": path}}
).result()
source = "/Path/to/zarr/directory/"
source_u = UPath(source)
res = _try_open_zarr(source_u)
Your Environment for bug
- webknossos version: 3.0.4
- Python version: 3.12
- OS: Rocky Linux