From c02daede48df1f451f42eeb05983737bca90fe99 Mon Sep 17 00:00:00 2001 From: Noah Golmant Date: Mon, 8 Jan 2024 15:00:27 -0800 Subject: [PATCH] fix coordinate extension to handle variable return shapes --- xee/ext.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xee/ext.py b/xee/ext.py index eaab42b..44c8674 100644 --- a/xee/ext.py +++ b/xee/ext.py @@ -568,15 +568,16 @@ def _process_coordinate_data( (tile_size * i, min(tile_size * (i + 1), end_point)) for i in range(tile_count) ] - tiles = [None] * tile_count + + coords = [] with concurrent.futures.ThreadPoolExecutor() as pool: for i, arr in pool.map( self._get_tile_from_ee, list(zip(data, itertools.cycle([coordinate_type]))), ): - tiles[i] = arr.tolist() if coordinate_type == 'x' else arr.tolist()[0] - return np.concatenate(tiles) - + coords.extend(arr.flatten()) + return np.array(coords) + def get_variables(self) -> utils.Frozen[str, xarray.Variable]: vars_ = [(name, self.open_store_variable(name)) for name in self._bands()]