From 2b6130da9eb35a9fe9f72ec723cfc9971ce228e8 Mon Sep 17 00:00:00 2001 From: Willi Rath Date: Fri, 24 Jan 2025 11:40:07 +0100 Subject: [PATCH] Regularize div by zero error --- xhistogram/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xhistogram/core.py b/xhistogram/core.py index 181325f..ca9985d 100644 --- a/xhistogram/core.py +++ b/xhistogram/core.py @@ -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,)