Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify expandChunk/shrinkChunk docstrings #330

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hsds/util/chunkUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_dset_size(shape_json, typesize):
def expandChunk(
layout, typesize, shape_json, chunk_min=CHUNK_MIN, layout_class="H5D_CHUNKED"
):
"""Extend the chunk shape until it is above the MIN target."""
"""Compute an increased chunk shape with a size in bytes greater than chunk_min."""
if shape_json is None or shape_json["class"] == "H5S_NULL":
return None
if shape_json["class"] == "H5S_SCALAR":
Expand Down Expand Up @@ -125,7 +125,7 @@ def expandChunk(


def shrinkChunk(layout, typesize, chunk_max=CHUNK_MAX, layout_class="H5D_CHUNKED"):
"""Shrink the chunk shape until it is less than the MAX target."""
"""Compute a reduced chunk shape with a size in bytes less than chunk_max."""
layout = list(layout)
chunk_size = getChunkSize(layout, typesize)
if chunk_size <= chunk_max:
Expand Down
Loading