Skip to content

Commit

Permalink
use partial for dak blockwise callables
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasdavis committed Dec 17, 2024
1 parent 1651347 commit d3cb1a1
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/dask_histogram/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,15 +1027,8 @@ def _partitioned_histogram(
if len(data) == 1 and data_is_dak:
from dask_awkward.lib.core import partitionwise_layer as dak_pwl

x = data[0]
if weights is not None and sample is not None:
g = dak_pwl(_blocked_dak, name, x, weights, sample, histref=histref)
elif weights is not None and sample is None:
g = dak_pwl(_blocked_dak, name, x, weights, None, histref=histref)
elif weights is None and sample is not None:
g = dak_pwl(_blocked_dak, name, x, None, sample, histref=histref)
else:
g = dak_pwl(_blocked_dak, name, x, None, None, histref=histref)
f = partial(_blocked_dak, weights=weights, sample=sample, histref=histref)
g = dak_pwl(f, name, data[0])

# Single object, not a dataframe
elif len(data) == 1 and not data_is_df:
Expand Down

0 comments on commit d3cb1a1

Please sign in to comment.