Skip to content

Commit 67ff171

Browse files
authored
align: Avoid reindexing when join="exact" (#7736)
* align: Avoid reindexing when join="exact" xref #7730 * Aligner.copy always copies ecen with join="exact" * Move logic to Aligner.align * Add whats-new
1 parent db2d414 commit 67ff171

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

doc/whats-new.rst

+6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ Breaking changes
4141
Deprecations
4242
~~~~~~~~~~~~
4343

44+
Performance
45+
~~~~~~~~~~~
46+
- Optimize alignment with ``join="exact", copy=False`` by avoiding copies. (:pull:`7736`)
47+
By `Deepak Cherian <https://github.com/dcherian>`_.
48+
- Avoid unnecessary copies of ``CFTimeIndex``. (:pull:`7735`)
49+
By `Deepak Cherian <https://github.com/dcherian>`_.
4450

4551
Bug fixes
4652
~~~~~~~~~

xarray/core/alignment.py

+2
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,8 @@ def align(self) -> None:
574574

575575
if self.join == "override":
576576
self.override_indexes()
577+
elif self.join == "exact" and not self.copy:
578+
self.results = self.objects
577579
else:
578580
self.reindex_all()
579581

0 commit comments

Comments
 (0)