diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index d5911ac1..db7ac28b 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -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, }, @@ -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 diff --git a/tests/unit/base_tests_zarrio.py b/tests/unit/base_tests_zarrio.py index d69becce..2a41dbb7 100644 --- a/tests/unit/base_tests_zarrio.py +++ b/tests/unit/base_tests_zarrio.py @@ -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: @@ -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):