Skip to content

Commit

Permalink
Replace if expression with min()
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos authored and FrancescAlted committed Apr 1, 2024
1 parent 9d099c1 commit 5b2918d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion blosc2/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ def compute_partition(nitems, parts, maxs, blocks=False):
"blocks should be smaller than chunks or shape in any dim!"
" If you do want this blocks, please specify a chunks too."
)
new_part = parts[i] * 2 if parts[i] * 2 <= maxs[i] else maxs[i]
new_part = min(parts[i] * 2, maxs[i])
if math.prod(parts) // parts[i] * new_part <= nitems:
parts[i] = new_part
nitems_new = math.prod(parts)
Expand Down

0 comments on commit 5b2918d

Please sign in to comment.