Skip to content
forked from pydata/xarray

Commit

Permalink
align: Avoid reindexing when join="exact"
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Apr 7, 2023
1 parent 4448828 commit ee18248
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions xarray/core/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,12 +552,15 @@ def _reindex_one(
return new_obj

def reindex_all(self) -> None:
self.results = tuple(
self._reindex_one(obj, matching_indexes)
for obj, matching_indexes in zip(
self.objects, self.objects_matching_indexes
if self.join != "exact":
self.results = tuple(
self._reindex_one(obj, matching_indexes)
for obj, matching_indexes in zip(
self.objects, self.objects_matching_indexes
)
)
)
else:
self.results = self.objects

def align(self) -> None:
if not self.indexes and len(self.objects) == 1:
Expand Down

0 comments on commit ee18248

Please sign in to comment.