Skip to content

Commit

Permalink
removed method of creating ChunkManifests from dicts
Browse files Browse the repository at this point in the history
  • Loading branch information
norlandrhagen committed Dec 21, 2024
1 parent 349386f commit c776ab9
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions virtualizarr/readers/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,31 +159,18 @@ async def build_zarray_metadata(zarr_array: zarr.AsyncArray):


async def virtual_variable_from_zarr_array(zarr_array: zarr.AsyncArray, filepath: str):
# zarr_prefix = "/"+zarr_array.basename
zarr_prefix = zarr_array.basename

if zarr_array.metadata.zarr_format == 3:
# if we have zarr_v3, we add /c/ to that chunk paths
# if we have Zarr format/version 3, we add /c/ to the chunk paths
zarr_prefix = f"{zarr_prefix}/c"

zarray_array = await build_zarray_metadata(zarr_array=zarr_array)

# build mapping between chunks and # of bytes (size)
chunk_manifest = await build_chunk_manifest(
zarr_array, prefix=zarr_prefix, filepath=filepath
)

# old method -> building chunk manifests from dicts
# chunk_map = await get_chunk_mapping_prefix(zarr_array, prefix=f"{array_name}/c")
# # transform chunk_map into ChunkManifest that fits into ManifestArray
# chunk_manifest = await build_chunk_manifest_from_dict_mapping(
# store_path=filepath,
# chunk_mapping_dict=chunk_map,
# array_name=array_name,
# zarr_format=zarray_array["zarray_array"].zarr_format,
# )

# build ManifestArray from dict
manifest_array = ManifestArray(
zarray=zarray_array["zarray_array"], chunkmanifest=chunk_manifest
)
Expand Down

0 comments on commit c776ab9

Please sign in to comment.