Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/hdmf_zarr/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def can_read(path):
"type": None,
"doc": (
"Set the numcodec object codec class to be used to encode objects."
"Use numcodecs.pickles.Pickle by default."
"Use numcodecs.json.JSON by default."
),
"default": None,
},
Expand Down Expand Up @@ -150,7 +150,7 @@ def __init__(self, **kwargs):
self._written_builders = WriteStatusTracker() # track which builders were written (or read) by this IO object
self.__dci_queue = None # Will be initialized on call to io.write
# Codec class to be used. Alternates, e.g., =numcodecs.JSON
self.__codec_cls = numcodecs.pickles.Pickle if object_codec_class is None else object_codec_class
self.__codec_cls = numcodecs.json.JSON if object_codec_class is None else object_codec_class
source_path = self.__path
if isinstance(self.__path, SUPPORTED_ZARR_STORES):
source_path = self.__path.path
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/base_tests_zarrio.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Try to import numcodecs and disable compression tests if it is not available
try:
from numcodecs import Blosc, Delta, JSON
from numcodecs import Blosc, Delta, Pickle

DISABLE_ZARR_COMPRESSION_TESTS = False
except ImportError:
Expand Down Expand Up @@ -517,12 +517,12 @@ def setUp(self):
# ZarrDataIO general
#############################################
def test_set_object_codec(self):
# Test that the default codec is the Pickle store
# Test that the default codec is the JSON store
tempIO = ZarrIO(self.store_path, mode="w")
self.assertEqual(tempIO.object_codec_class.__qualname__, "Pickle")
del tempIO # also calls tempIO.close()
tempIO = ZarrIO(self.store_path, mode="w", object_codec_class=JSON)
self.assertEqual(tempIO.object_codec_class.__qualname__, "JSON")
del tempIO # also calls tempIO.close()
tempIO = ZarrIO(self.store_path, mode="w", object_codec_class=Pickle)
self.assertEqual(tempIO.object_codec_class.__qualname__, "Pickle")
tempIO.close()

def test_synchronizer_constructor_arg_bool(self):
Expand Down
Loading