Skip to content

Commit

Permalink
Regularize div by zero error
Browse files Browse the repository at this point in the history
  • Loading branch information
willirath authored Jan 24, 2025
1 parent a73be2f commit 2b6130d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xhistogram/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _determine_block_chunks(bin_indices, block_size):
# automatically pick a chunk size
# this a a heueristic without much basis
_MAX_CHUNK_SIZE = 10_000_000
block_size = min(_MAX_CHUNK_SIZE // N, M)
block_size = min(_MAX_CHUNK_SIZE // N + 1, M)
assert isinstance(block_size, int)
num_chunks = M // block_size
block_chunks = num_chunks * (block_size,)
Expand Down

0 comments on commit 2b6130d

Please sign in to comment.