From a83004bba9b2cfac790d35a3fe95050de6667ce9 Mon Sep 17 00:00:00 2001 From: thijsvl Date: Fri, 12 Apr 2024 16:18:52 +0200 Subject: [PATCH] Fixed unit tests by checking chunksizes for the existence of 'time' --- stmtools/stm.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/stmtools/stm.py b/stmtools/stm.py index e72742d..b402c50 100644 --- a/stmtools/stm.py +++ b/stmtools/stm.py @@ -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)