def create_array(read_only=False, **kwargs): path = mkdtemp() atexit.register(shutil.rmtree, path) store = NestedDirectoryStore(path) kwargs.setdefault('compressor', Zlib(1)) init_array(store, **kwargs) return Array(store, read_only=read_only)
def test_nested(dataset): """ Use NestedDirectoryStore to open the dataset fixture. This is the only method that is expected to successfully open legacy nested datasets without the dimension_separator metadata. However, for none-Nested datasets without any metadata, NestedDirectoryStore will fail. """ failure = ("flat_legacy" in dataset or "directory_default" in dataset or "fs_default" in dataset) verify(Array(store=NestedDirectoryStore(dataset)), failure)
def create_store(): path = tempfile.mkdtemp() atexit.register(atexit_rmtree, path) store = NestedDirectoryStore(path) return store, None