Exemple #1
0
    def test_init_array(self):
        store = self.create_store()
        init_array(store, shape=1000, chunks=100)

        # check metadata
        assert array_meta_key in store
        meta = decode_array_metadata(store[array_meta_key])
        assert ZARR_FORMAT == meta['zarr_format']
        assert (1000, ) == meta['shape']
        assert (100, ) == meta['chunks']
        assert np.dtype(None) == meta['dtype']
        assert default_compressor.get_config() == meta['compressor']
        assert meta['fill_value'] is None
Exemple #2
0
    def test_init_array(self):
        store = self.create_store()
        init_array(store, shape=1000, chunks=100)

        # check metadata
        assert array_meta_key in store
        meta = decode_array_metadata(store[array_meta_key])
        eq(ZARR_FORMAT, meta['zarr_format'])
        eq((1000,), meta['shape'])
        eq((100,), meta['chunks'])
        eq(np.dtype(None), meta['dtype'])
        eq(default_compressor.get_config(), meta['compressor'])
        assert_is_none(meta['fill_value'])
Exemple #3
0
    def test_init_array(self):
        store = self.create_store()
        init_array(store, shape=1000, chunks=100)

        # check metadata
        assert array_meta_key in store
        meta = decode_array_metadata(store[array_meta_key])
        eq(ZARR_FORMAT, meta['zarr_format'])
        eq((1000, ), meta['shape'])
        eq((100, ), meta['chunks'])
        eq(np.dtype(None), meta['dtype'])
        eq(default_compressor.get_config(), meta['compressor'])
        assert_is_none(meta['fill_value'])

        # check attributes
        assert attrs_key in store
        eq(dict(), json.loads(text_type(store[attrs_key], 'ascii')))
Exemple #4
0
    def test_init_array_path(self):
        path = 'foo/bar'
        store = self.create_store()
        init_array(store, shape=1000, chunks=100, path=path)

        # check metadata
        key = path + '/' + array_meta_key
        assert key in store
        meta = decode_array_metadata(store[key])
        eq(ZARR_FORMAT, meta['zarr_format'])
        eq((1000,), meta['shape'])
        eq((100,), meta['chunks'])
        eq(np.dtype(None), meta['dtype'])
        eq(default_compressor.get_config(), meta['compressor'])
        assert_is_none(meta['fill_value'])

        # check attributes
        key = path + '/' + attrs_key
        assert key in store
        eq(dict(), json.loads(text_type(store[key], 'ascii')))