MCPcopy Index your code
hub / github.com/pydata/xarray / __or__

Method __or__

xarray/core/coordinates.py:586–613  ·  view source on GitHub ↗

Merge two sets of coordinates to create a new Coordinates object The method implements the logic used for joining coordinates in the result of a binary operation performed on xarray objects: - If two index coordinates conflict (are not equal), an exception is rais

(self, other: Mapping[Any, Any] | None)

Source from the content-addressed store, hash-verified

584 )
585
586 def __or__(self, other: Mapping[Any, Any] | None) -> Coordinates:
587 """Merge two sets of coordinates to create a new Coordinates object
588
589 The method implements the logic used for joining coordinates in the
590 result of a binary operation performed on xarray objects:
591
592 - If two index coordinates conflict (are not equal), an exception is
593 raised. You must align your data before passing it to this method.
594 - If an index coordinate and a non-index coordinate conflict, the non-
595 index coordinate is dropped.
596 - If two non-index coordinates conflict, both are dropped.
597
598 Parameters
599 ----------
600 other : dict-like, optional
601 A :py:class:`Coordinates` object or any mapping that can be turned
602 into coordinates.
603
604 Returns
605 -------
606 merged : Coordinates
607 A new Coordinates object with merged coordinates.
608
609 See Also
610 --------
611 Coordinates.merge
612 """
613 return self.merge(other).coords
614
615 def __setitem__(self, key: Hashable, value: Any) -> None:
616 self.update({key: value})

Callers

nothing calls this directly

Calls 1

mergeMethod · 0.95

Tested by

no test coverage detected