def _load_metadata_nosync(self): try: mkey = self._key_prefix + array_meta_key meta_bytes = self._store[mkey] except KeyError: err_array_not_found(self._path) else: # decode and store metadata meta = decode_array_metadata(meta_bytes) self._meta = meta self._shape = meta['shape'] self._chunks = meta['chunks'] self._dtype = meta['dtype'] self._fill_value = meta['fill_value'] self._order = meta['order'] # setup compressor config = meta['compressor'] if config is None: self._compressor = None else: self._compressor = get_codec(config) # setup filters filters = meta['filters'] if filters: filters = [get_codec(config) for config in filters] self._filters = filters
def test_get_codec(): with assert_raises(ValueError): get_codec({'id': 'foo'})