Skip to content

Commit

Permalink
Fixed unit tests by checking chunksizes for the existence of 'time'
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsvl committed Apr 12, 2024
1 parent 5ea911b commit a83004b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions stmtools/stm.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,12 @@ def reorder(self, xlabel="azimuth", ylabel="range", xscale=1.0, yscale=1.0):
self._obj = self.get_order(xlabel, ylabel, xscale, yscale)

# Sorting may split up the chunks, which may interfere with later operations, so we immediately restore the chunk sizes.
chunks = {
"space": self._obj.chunksizes["space"][0],
"time": self._obj.chunksizes["time"][0],
}
chunks = {"space": self._obj.chunksizes["space"][0]}
if "time" in self._obj.chunksizes:
chunks = {
"space": self._obj.chunksizes["space"][0],
"time": self._obj.chunksizes["time"][0],
}
self._obj = self._obj.sortby(self._obj.order)
self._obj = self._obj.chunk(chunks)

Expand Down

0 comments on commit a83004b

Please sign in to comment.