xarray_beam.MeanCombineFn

class xarray_beam.MeanCombineFn(sum_and_count=None, finalize=True)

CombineFn for computing an arithmetic mean of xarray.Dataset objects.

Parameters:
  • sum_and_count (_SumAndCount | None)

  • finalize (bool)

__init__(sum_and_count=None, finalize=True)
Parameters:
  • sum_and_count (_SumAndCount | None)

  • finalize (bool)

Return type:

None

Methods

__init__([sum_and_count, finalize])

add_input(sum_count, element)

Return result of folding element into accumulator.

add_inputs(mutable_accumulator, elements, ...)

Returns the result of folding each element in elements into accumulator.

apply(elements, *args, **kwargs)

Returns result of applying this CombineFn to the input values.

compact(accumulator, *args, **kwargs)

Optionally returns a more compact representation of the accumulator.

create_accumulator()

Return a fresh, empty accumulator for the combine operation.

default_label()

default_type_hints()

display_data()

Returns the display data associated to a pipeline component.

extract_output(sum_count)

Return result of converting accumulator into the output value.

for_input_type(input_type)

Returns a specialized implementation of self, if it exists.

from_callable(fn)

from_runner_api(fn_proto, context)

Converts from an FunctionSpec to a Fn object.

get_accumulator_coder()

get_type_hints()

Gets and/or initializes type hints for this object.

maybe_from_callable(fn[, has_side_inputs])

merge_accumulators(accumulators)

Returns the result of merging several accumulators to a single accumulator value.

register_pickle_urn(pickle_urn)

Registers and implements the given urn via pickling.

register_urn(urn, parameter_type[, fn])

Registers a urn with a constructor.

setup(*args, **kwargs)

Called to prepare an instance for combining.

teardown(*args, **kwargs)

Called to clean up an instance before it is discarded.

to_runner_api(context)

Returns an FunctionSpec encoding this Fn.

to_runner_api_parameter(context)

Returns the urn and payload for this Fn.

with_input_types(*arg_hints, **kwarg_hints)

with_output_types(*arg_hints, **kwarg_hints)

Attributes

finalize

sum_and_count