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

Function merge_coords

xarray/structure/merge.py:592–614  ·  view source on GitHub ↗

Merge coordinate variables. See merge_core below for argument descriptions. This works similarly to merge_core, except everything we don't worry about whether variables are coordinates or not.

(
    objects: Iterable[CoercibleMapping],
    compat: CompatOptions = "minimal",
    join: JoinOptions = "outer",
    priority_arg: int | None = None,
    indexes: Mapping[Any, Index] | None = None,
    fill_value: object = dtypes.NA,
)

Source from the content-addressed store, hash-verified

590
591
592def merge_coords(
593 objects: Iterable[CoercibleMapping],
594 compat: CompatOptions = "minimal",
595 join: JoinOptions = "outer",
596 priority_arg: int | None = None,
597 indexes: Mapping[Any, Index] | None = None,
598 fill_value: object = dtypes.NA,
599) -> tuple[dict[Hashable, Variable], dict[Hashable, Index]]:
600 """Merge coordinate variables.
601
602 See merge_core below for argument descriptions. This works similarly to
603 merge_core, except everything we don't worry about whether variables are
604 coordinates or not.
605 """
606 _assert_compat_valid(compat)
607 coerced = coerce_pandas_values(objects)
608 aligned = deep_align(
609 coerced, join=join, copy=False, indexes=indexes, fill_value=fill_value
610 )
611 collected = collect_variables_and_indexes(aligned, indexes=indexes)
612 prioritized = _get_priority_vars_and_indexes(aligned, priority_arg, compat=compat)
613 variables, out_indexes = merge_collected(collected, prioritized, compat=compat)
614 return variables, out_indexes
615
616
617def equivalent_attrs(a: Any, b: Any) -> bool:

Callers 2

updateMethod · 0.90
_flox_reduceMethod · 0.90

Calls 6

deep_alignFunction · 0.90
_assert_compat_validFunction · 0.85
coerce_pandas_valuesFunction · 0.85
merge_collectedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…