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