MCPcopy
hub / github.com/pydata/xarray / merge_core

Function merge_core

xarray/structure/merge.py:696–800  ·  view source on GitHub ↗

Core logic for merging labeled objects. This is not public API. Parameters ---------- objects : list of mapping All values must be convertible to labeled arrays. compat : {"identical", "equals", "broadcast_equals", "no_conflicts", "override"}, optional Compatibi

(
    objects: Iterable[CoercibleMapping],
    compat: CompatOptions | CombineKwargDefault,
    join: JoinOptions | CombineKwargDefault,
    combine_attrs: CombineAttrsOptions = "override",
    priority_arg: int | None = None,
    explicit_coords: Iterable[Hashable] | None = None,
    indexes: Mapping[Any, Any] | None = None,
    fill_value: object = dtypes.NA,
    skip_align_args: list[int] | None = None,
)

Source from the content-addressed store, hash-verified

694
695
696def merge_core(
697 objects: Iterable[CoercibleMapping],
698 compat: CompatOptions | CombineKwargDefault,
699 join: JoinOptions | CombineKwargDefault,
700 combine_attrs: CombineAttrsOptions = "override",
701 priority_arg: int | None = None,
702 explicit_coords: Iterable[Hashable] | None = None,
703 indexes: Mapping[Any, Any] | None = None,
704 fill_value: object = dtypes.NA,
705 skip_align_args: list[int] | None = None,
706) -> _MergeResult:
707 """Core logic for merging labeled objects.
708
709 This is not public API.
710
711 Parameters
712 ----------
713 objects : list of mapping
714 All values must be convertible to labeled arrays.
715 compat : {"identical", "equals", "broadcast_equals", "no_conflicts", "override"}, optional
716 Compatibility checks to use when merging variables.
717 join : {"outer", "inner", "left", "right"}, optional
718 How to combine objects with different indexes.
719 combine_attrs : {"drop", "identical", "no_conflicts", "drop_conflicts", \
720 "override"} or callable, default: "override"
721 How to combine attributes of objects
722 priority_arg : int, optional
723 Optional argument in `objects` that takes precedence over the others.
724 explicit_coords : set, optional
725 An explicit list of variables from `objects` that are coordinates.
726 indexes : dict, optional
727 Dictionary with values given by xarray.Index objects or anything that
728 may be cast to pandas.Index objects.
729 fill_value : scalar, optional
730 Value to use for newly missing values
731 skip_align_args : list of int, optional
732 Optional arguments in `objects` that are not included in alignment.
733
734 Returns
735 -------
736 variables : dict
737 Dictionary of Variable objects.
738 coord_names : set
739 Set of coordinate names.
740 dims : dict
741 Dictionary mapping from dimension names to sizes.
742 attrs : dict
743 Dictionary of attributes
744 """
745 from xarray.core.dataarray import DataArray
746 from xarray.core.dataset import Dataset
747
748 _assert_compat_valid(compat)
749
750 objects = list(objects)
751 if skip_align_args is None:
752 skip_align_args = []
753

Callers 5

merge_treesFunction · 0.85
mergeFunction · 0.85
dataset_merge_methodFunction · 0.85
dataset_update_methodFunction · 0.85
merge_data_and_coordsFunction · 0.85

Calls 13

deep_alignFunction · 0.90
calculate_dimensionsFunction · 0.90
_assert_compat_validFunction · 0.85
coerce_pandas_valuesFunction · 0.85
merge_collectedFunction · 0.85
determine_coordsFunction · 0.85
MergeErrorClass · 0.85
merge_attrsFunction · 0.85
_MergeResultClass · 0.85
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…