Skip to content

Commit

Permalink
make tensorstore import optional
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollman committed Feb 2, 2024
1 parent 7862de0 commit 4e6ebb8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/neuroglancer/write_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
import struct
from collections.abc import Sequence
from typing import Literal, NamedTuple, Optional, Union, cast
import tensorstore as ts
import logging
try:
import tensorstore as ts
except ImportError:
logging.warning('Sharded write support requires tensorstore, Install with pip install tensorstore')
ts = None
import numpy as np

from . import coordinate_space, viewer_state
Expand Down Expand Up @@ -93,6 +98,8 @@ def choose_output_spec(total_count, total_bytes,
gzip_compress=True):
if total_count == 1:
return None
if ts is None:
return None

# test if hashtype is valid
if hashtype not in ["murmurhash3_x86_128", "identity_hash"]:
Expand Down

0 comments on commit 4e6ebb8

Please sign in to comment.