Re-index either a Dataset or a DataArray like another Dataset/DataArray. Not public API.
(
obj: T_Alignable,
other: Dataset | DataArray,
method: str | None = None,
tolerance: float | Iterable[float] | str | None = None,
copy: bool = True,
fill_value: Any = dtypes.NA,
)
| 1086 | |
| 1087 | |
| 1088 | def reindex_like( |
| 1089 | obj: T_Alignable, |
| 1090 | other: Dataset | DataArray, |
| 1091 | method: str | None = None, |
| 1092 | tolerance: float | Iterable[float] | str | None = None, |
| 1093 | copy: bool = True, |
| 1094 | fill_value: Any = dtypes.NA, |
| 1095 | ) -> T_Alignable: |
| 1096 | """Re-index either a Dataset or a DataArray like another Dataset/DataArray. |
| 1097 | |
| 1098 | Not public API. |
| 1099 | |
| 1100 | """ |
| 1101 | if not other._indexes: |
| 1102 | # This check is not performed in Aligner. |
| 1103 | for dim in other.dims: |
| 1104 | if dim in obj.dims: |
| 1105 | other_size = other.sizes[dim] |
| 1106 | obj_size = obj.sizes[dim] |
| 1107 | if other_size != obj_size: |
| 1108 | raise ValueError( |
| 1109 | "different size for unlabeled " |
| 1110 | f"dimension on argument {dim!r}: {other_size!r} vs {obj_size!r}" |
| 1111 | ) |
| 1112 | |
| 1113 | return reindex( |
| 1114 | obj, |
| 1115 | indexers=other.xindexes, |
| 1116 | method=method, |
| 1117 | tolerance=tolerance, |
| 1118 | copy=copy, |
| 1119 | fill_value=fill_value, |
| 1120 | ) |
| 1121 | |
| 1122 | |
| 1123 | def _get_broadcast_dims_map_common_coords(args, exclude): |
nothing calls this directly
no test coverage detected
searching dependent graphs…