xarray_beam.MeanCombineFn

class xarray_beam.MeanCombineFn(dim=None, skipna=True, dtype=None)

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

Parameters:
  • dim (Optional[Union[str, Sequence[str]]]) –

  • skipna (bool) –

  • dtype (Union[dtype[Any], None, Type[Any], _SupportsDType[dtype[Any]], str, Tuple[Any, int], Tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], List[Any], _DTypeDict, Tuple[Any, Any]]) –

__init__(dim=None, skipna=True, dtype=None)
Parameters:
  • dim (Optional[Union[str, Sequence[str]]]) –

  • skipna (bool) –

  • dtype (Union[dtype[Any], None, Type[Any], _SupportsDType[dtype[Any]], str, Tuple[Any, int], Tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], List[Any], _DTypeDict, Tuple[Any, Any]]) –

Return type:

None

Methods

__init__([dim, skipna, dtype])

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 represenation 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

dim

dtype

skipna