Skip to content

Commit 9a2320c

Browse files
committed
add split_every to numpy like routines
1 parent feff206 commit 9a2320c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/dask_histogram/routines.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def histogram(
3838
histogram: Any | None = None,
3939
storage: bh.storage.Storage = bh.storage.Double(),
4040
threads: int | None = None,
41+
split_every: int | None = None,
4142
) -> AggHistogram | tuple[da.Array, ...] | tuple[da.Array, list[da.Array]]:
4243
"""Histogram Dask data in one dimension.
4344
@@ -121,6 +122,7 @@ def histogram(
121122
histogram=True,
122123
storage=storage,
123124
threads=threads,
125+
split_every=split_every,
124126
)
125127
if histogram is None:
126128
return h.to_dask_array(flow=False, dd=False) # type: ignore
@@ -139,6 +141,7 @@ def histogram2d(
139141
histogram: Any | None = None,
140142
storage: bh.storage.Storage = bh.storage.Double(),
141143
threads: int | None = None,
144+
split_every: int | None = None,
142145
) -> AggHistogram | tuple[da.Array, ...]:
143146
"""Histogram Dask data in two dimensions.
144147
@@ -244,6 +247,7 @@ def histogram2d(
244247
histogram=True,
245248
storage=storage,
246249
threads=threads,
250+
split_every=split_every,
247251
)
248252
if histogram is None:
249253
return h.to_dask_array(flow=False, dd=False) # type: ignore
@@ -261,6 +265,7 @@ def histogramdd(
261265
histogram: Any | None = None,
262266
storage: bh.storage.Storage = bh.storage.Double(),
263267
threads: int | None = None,
268+
split_every: int | None = None,
264269
) -> AggHistogram | tuple[da.Array, list[da.Array]]:
265270
"""Histogram Dask data in multiple dimensions.
266271
@@ -446,7 +451,13 @@ def histogramdd(
446451
axes.append(bh.axis.Regular(bins=b, start=r[0], stop=r[1])) # type: ignore
447452

448453
# Finally create the histogram object.
449-
ah = factory(*a, axes=axes, storage=storage, weights=weights)
454+
ah = factory(
455+
*a,
456+
axes=axes,
457+
storage=storage,
458+
weights=weights,
459+
split_every=split_every,
460+
)
450461

451462
if histogram is not None:
452463
return ah # type: ignore

0 commit comments

Comments
 (0)