hydromodpy.results.zarr_store.chunks#

Balanced chunk and sharding heuristics for Zarr v2 stores.

Functions

compute_balanced_chunks_1d(n_timesteps, ...)

Return a (time_chunk, cell_chunk) pair near the target chunk size.

compute_balanced_chunks_2d(n_timesteps, ...)

Return (time_chunk, layer_chunk, cell_chunk) near the target size.

compute_shard_shape_1d(n_timesteps, chunk_shape)

Return the shard shape for a 1D-per-step variable, or None if unfit.

compute_shard_shape_2d(n_timesteps, chunk_shape)

Return the shard shape for a 2D-per-step variable, or None if unfit.

should_use_sharding(n_timesteps, ...[, ...])

Return True when the variable footprint warrants a ShardingCodec.