(
pairs,
sum=chunk.sum,
numel=numel,
dtype="f8",
axis=None,
computing_meta=False,
**kwargs,
)
| 341 | |
| 342 | |
| 343 | def mean_combine( |
| 344 | pairs, |
| 345 | sum=chunk.sum, |
| 346 | numel=numel, |
| 347 | dtype="f8", |
| 348 | axis=None, |
| 349 | computing_meta=False, |
| 350 | **kwargs, |
| 351 | ): |
| 352 | if not isinstance(pairs, list): |
| 353 | pairs = [pairs] |
| 354 | |
| 355 | ns = deepmap(lambda pair: pair["n"], pairs) if not computing_meta else pairs |
| 356 | n = _concatenate2(ns, axes=axis).sum(axis=axis, **kwargs) |
| 357 | |
| 358 | if computing_meta: |
| 359 | return n |
| 360 | |
| 361 | totals = deepmap(lambda pair: pair["total"], pairs) |
| 362 | total = _concatenate2(totals, axes=axis).sum(axis=axis, **kwargs) |
| 363 | |
| 364 | return {"n": n, "total": total} |
| 365 | |
| 366 | |
| 367 | def mean_agg(pairs, dtype="f8", axis=None, computing_meta=False, **kwargs): |
nothing calls this directly
no test coverage detected